Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: test/action_platform-test.js

Issue 10233013: Crawler, second version (Closed)
Patch Set: Created April 12, 2013, 1:38 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « metadata.gecko ('k') | test/jsTestDriver.conf » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/action_platform-test.js
===================================================================
new file mode 100644
--- /dev/null
+++ b/test/action_platform-test.js
@@ -0,0 +1,42 @@
+/**
+ * @fileOverview A platform-specific primitive set for the module action.js. This is targeted at the js-test-driver,
+ * which uses the browser.
+ */
+
+/**
+ * @namespace
+ */
+Action_Platform = {};
+
+Action_Platform.dispatch = function( f )
+{
+ return setTimeout( f, 0 );
+};
+
+Action_Platform.set_timer = function( f, duration )
+{
+ return setTimeout( f, duration )
+};
+
+Action_Platform.clear_timer = function( id )
+{
+ clearTimeout( id );
+};
+
+/**
+ * The file "action.js" is targeted for the ABP bootstrapped extension environment. We need an implementation of
+ * require() to make it work.
+ *
+ * @param module_name
+ * @return {{Action_Platform: *}}
+ */
+function require( module_name )
+{
+ switch ( module_name )
+ {
+ case "action_platform":
+ return { Action_Platform: Action_Platform };
+ default:
+ throw new Error( "Module name not recognized." );
+ }
+}
« no previous file with comments | « metadata.gecko ('k') | test/jsTestDriver.conf » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld