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

Unified Diff: content/shell/layout_test_controller.js

Issue 10740002: Stub out not yet implemented controller methods, so we don't have to wait for timeouts but fail imm… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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: content/shell/layout_test_controller.js
diff --git a/content/shell/layout_test_controller.js b/content/shell/layout_test_controller.js
index 1ace50cadc0d9c4931b5438dea394dd73e2c9577..41ee38ee00f92a9b3c90ab086d44687fccf7c26c 100644
--- a/content/shell/layout_test_controller.js
+++ b/content/shell/layout_test_controller.js
@@ -4,6 +4,10 @@
var layoutTestController = layoutTestController || {};
var testRunner = testRunner || {};
+var accessibilityController = accessibilityController || {};
+var gamepadController = gamepadController || {};
+var eventSender = eventSender || {};
+var textInputController = textInputController || {};
(function() {
native function NotifyDone();
@@ -13,16 +17,53 @@ var testRunner = testRunner || {};
native function SetShouldStayOnPageAfterHandlingBeforeUnload();
native function SetWaitUntilDone();
- layoutTestController = new function() {
- this.notifyDone = NotifyDone;
- this.dumpAsText = SetDumpAsText;
- this.dumpChildFramesAsText = SetDumpChildFramesAsText;
- this.setPrinting = SetPrinting;
- this.setShouldStayOnPageAfterHandlingBeforeUnload =
- SetShouldStayOnPageAfterHandlingBeforeUnload;
- this.waitUntilDone = SetWaitUntilDone;
- }();
+ native function NotImplemented();
- testRunner = layoutTestController;
+ var DefaultHandler = function(name) {
+ var handler = {
+ get: function(receiver, property) {
+ return function() {
+ return NotImplemented(name, property);
+ }
+ }
+ }
+ return Proxy.create(handler);
+ }
+ var defineProperty = function(obj, name, callback) {
+ Object.defineProperty(obj, name, { get: function() { return callback; },
rossberg 2012/07/09 15:54:29 Tip: {value: callback} should be good enough her
jochen (gone - plz use gerrit) 2012/07/09 19:25:52 Done.
+ configurable: false });
+ }
+
+ var LayoutTestController = function() {
+ defineProperty(this, "notifyDone", NotifyDone);
+ defineProperty(this, "dumpAsText", SetDumpAsText);
+ defineProperty(this,
+ "dumpChildFramesAsText",
+ SetDumpChildFramesAsText);
+ defineProperty(this, "setPrinting", SetPrinting);
+ defineProperty(this,
+ "setShouldStayOnPageAfterHandlingBeforeUnload",
+ SetShouldStayOnPageAfterHandlingBeforeUnload);
+ defineProperty(this, "waitUntilDone", SetWaitUntilDone);
+ }
+ LayoutTestController.prototype = DefaultHandler("layoutTestController");
+ layoutTestController = new LayoutTestController();
+ testRunner = new LayoutTestController();
+
+ var AccessibilityController = function() {}
+ AccessibilityController.prototype = DefaultHandler("accessibilityController");
+ accessibilityController = new AccessibilityController();
+
+ var GamepadController = function() {}
+ GamepadController.prototype = DefaultHandler("gamepadController");
+ gamepadController = new GamepadController();
+
+ var EventSender = function() {}
+ EventSender.prototype = DefaultHandler("eventSender");
+ eventSender = new EventSender();
+
+ var TextInputController = function() {}
+ TextInputController.prototype = DefaultHandler("textInputController");
+ textInputController = new TextInputController();
})();
« no previous file with comments | « no previous file | content/shell/layout_test_controller_bindings.cc » ('j') | content/shell/layout_test_controller_bindings.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698