Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4953)

Unified Diff: chrome/test/data/third_party/spaceport/js/util/timeout.js

Issue 10154006: Add test data for spaceport benchmark. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/third_party/spaceport/js/util/timeout.js
diff --git a/chrome/test/data/third_party/spaceport/js/util/timeout.js b/chrome/test/data/third_party/spaceport/js/util/timeout.js
new file mode 100644
index 0000000000000000000000000000000000000000..9385a69c008f72d7713e06d1fe12000d323f3162
--- /dev/null
+++ b/chrome/test/data/third_party/spaceport/js/util/timeout.js
@@ -0,0 +1,14 @@
+define([ 'util/ensureCallback' ], function (ensureCallback) {
+ return function timeout(duration, fn, callback) {
+ callback = ensureCallback(callback);
+
+ var id = setTimeout(function () {
+ callback(new Error('Operation timed out'));
+ }, duration);
+
+ fn(function () {
+ clearTimeout(id);
+ callback.apply(this, arguments);
+ });
+ };
+});
« no previous file with comments | « chrome/test/data/third_party/spaceport/js/util/report.js ('k') | chrome/test/data/third_party/spaceport/package.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698