| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 var layoutTestController = layoutTestController || {}; | 5 var layoutTestController = layoutTestController || {}; |
| 6 var testRunner = testRunner || {}; | 6 var testRunner = testRunner || {}; |
| 7 var accessibilityController = accessibilityController || {}; |
| 8 var gamepadController = gamepadController || {}; |
| 9 var eventSender = eventSender || {}; |
| 10 var textInputController = textInputController || {}; |
| 7 | 11 |
| 8 (function() { | 12 (function() { |
| 9 native function NotifyDone(); | 13 native function NotifyDone(); |
| 10 native function SetDumpAsText(); | 14 native function SetDumpAsText(); |
| 11 native function SetDumpChildFramesAsText(); | 15 native function SetDumpChildFramesAsText(); |
| 12 native function SetPrinting(); | 16 native function SetPrinting(); |
| 13 native function SetShouldStayOnPageAfterHandlingBeforeUnload(); | 17 native function SetShouldStayOnPageAfterHandlingBeforeUnload(); |
| 14 native function SetWaitUntilDone(); | 18 native function SetWaitUntilDone(); |
| 15 | 19 |
| 16 layoutTestController = new function() { | 20 native function NotImplemented(); |
| 17 this.notifyDone = NotifyDone; | |
| 18 this.dumpAsText = SetDumpAsText; | |
| 19 this.dumpChildFramesAsText = SetDumpChildFramesAsText; | |
| 20 this.setPrinting = SetPrinting; | |
| 21 this.setShouldStayOnPageAfterHandlingBeforeUnload = | |
| 22 SetShouldStayOnPageAfterHandlingBeforeUnload; | |
| 23 this.waitUntilDone = SetWaitUntilDone; | |
| 24 }(); | |
| 25 | 21 |
| 26 testRunner = layoutTestController; | 22 var DefaultHandler = function(name) { |
| 23 var handler = { |
| 24 get: function(receiver, property) { |
| 25 return function() { |
| 26 return NotImplemented(name, property); |
| 27 } |
| 28 } |
| 29 } |
| 30 return Proxy.create(handler); |
| 31 } |
| 27 | 32 |
| 33 var LayoutTestController = function() { |
| 34 Object.defineProperty(this, "notifyDone", {value: NotifyDone}); |
| 35 Object.defineProperty(this, "dumpAsText", {value: SetDumpAsText}); |
| 36 Object.defineProperty(this, |
| 37 "dumpChildFramesAsText", |
| 38 {value: SetDumpChildFramesAsText}); |
| 39 Object.defineProperty(this, "setPrinting", {value: SetPrinting}); |
| 40 Object.defineProperty( |
| 41 this, |
| 42 "setShouldStayOnPageAfterHandlingBeforeUnload", |
| 43 {value: SetShouldStayOnPageAfterHandlingBeforeUnload}); |
| 44 Object.defineProperty(this, "waitUntilDone", {value: SetWaitUntilDone}); |
| 45 } |
| 46 LayoutTestController.prototype = DefaultHandler("layoutTestController"); |
| 47 layoutTestController = new LayoutTestController(); |
| 48 testRunner = new LayoutTestController(); |
| 49 |
| 50 var AccessibilityController = function() {} |
| 51 AccessibilityController.prototype = DefaultHandler("accessibilityController"); |
| 52 accessibilityController = new AccessibilityController(); |
| 53 |
| 54 var GamepadController = function() {} |
| 55 GamepadController.prototype = DefaultHandler("gamepadController"); |
| 56 gamepadController = new GamepadController(); |
| 57 |
| 58 var EventSender = function() {} |
| 59 EventSender.prototype = DefaultHandler("eventSender"); |
| 60 eventSender = new EventSender(); |
| 61 |
| 62 var TextInputController = function() {} |
| 63 TextInputController.prototype = DefaultHandler("textInputController"); |
| 64 textInputController = new TextInputController(); |
| 28 })(); | 65 })(); |
| OLD | NEW |