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 testRunner = testRunner || {}; | 5 var testRunner = testRunner || {}; |
6 | 6 |
7 (function() { | 7 (function() { |
8 native function Display(); | 8 native function Display(); |
9 native function GetWorkerThreadCount(); | 9 native function GetWorkerThreadCount(); |
10 native function NotifyDone(); | 10 native function NotifyDone(); |
11 native function SetDumpAsText(); | 11 native function SetDumpAsText(); |
12 native function SetDumpChildFramesAsText(); | 12 native function SetDumpChildFramesAsText(); |
13 native function SetPrinting(); | 13 native function SetPrinting(); |
14 native function SetShouldStayOnPageAfterHandlingBeforeUnload(); | 14 native function SetShouldStayOnPageAfterHandlingBeforeUnload(); |
15 native function SetWaitUntilDone(); | 15 native function SetWaitUntilDone(); |
| 16 native function SetXSSAuditorEnabled(); |
16 | 17 |
17 native function NotImplemented(); | 18 native function NotImplemented(); |
18 | 19 |
19 var DefaultHandler = function(name) { | 20 var DefaultHandler = function(name) { |
20 var handler = { | 21 var handler = { |
21 get: function(receiver, property) { | 22 get: function(receiver, property) { |
22 NotImplemented(name, property); | 23 NotImplemented(name, property); |
23 return function() {} | 24 return function() {} |
24 }, | 25 }, |
25 getPropertyDescriptor: function(property) { | 26 getPropertyDescriptor: function(property) { |
(...skipping 12 matching lines...) Expand all Loading... |
38 Object.defineProperty(this, "notifyDone", {value: NotifyDone}); | 39 Object.defineProperty(this, "notifyDone", {value: NotifyDone}); |
39 Object.defineProperty(this, "dumpAsText", {value: SetDumpAsText}); | 40 Object.defineProperty(this, "dumpAsText", {value: SetDumpAsText}); |
40 Object.defineProperty(this, | 41 Object.defineProperty(this, |
41 "dumpChildFramesAsText", | 42 "dumpChildFramesAsText", |
42 {value: SetDumpChildFramesAsText}); | 43 {value: SetDumpChildFramesAsText}); |
43 Object.defineProperty(this, "setPrinting", {value: SetPrinting}); | 44 Object.defineProperty(this, "setPrinting", {value: SetPrinting}); |
44 Object.defineProperty( | 45 Object.defineProperty( |
45 this, | 46 this, |
46 "setShouldStayOnPageAfterHandlingBeforeUnload", | 47 "setShouldStayOnPageAfterHandlingBeforeUnload", |
47 {value: SetShouldStayOnPageAfterHandlingBeforeUnload}); | 48 {value: SetShouldStayOnPageAfterHandlingBeforeUnload}); |
| 49 Object.defineProperty(this, |
| 50 "setXSSAuditorEnabled", |
| 51 {value: SetXSSAuditorEnabled}); |
48 Object.defineProperty(this, "waitUntilDone", {value: SetWaitUntilDone}); | 52 Object.defineProperty(this, "waitUntilDone", {value: SetWaitUntilDone}); |
49 | 53 |
50 var stubs = [ | 54 var stubs = [ |
51 "overridePreference", // not really a stub, but required to pass | 55 "overridePreference", // not really a stub, but required to pass |
52 // content_browsertests for now. | 56 // content_browsertests for now. |
53 "dumpDatabaseCallbacks", | 57 "dumpDatabaseCallbacks", |
54 "denyWebNotificationPermission", | 58 "denyWebNotificationPermission", |
55 "removeAllWebNotificationPermissions", | 59 "removeAllWebNotificationPermissions", |
56 "simulateWebNotificationClick", | 60 "simulateWebNotificationClick", |
57 "setIconDatabaseEnabled", | 61 "setIconDatabaseEnabled", |
(...skipping 16 matching lines...) Expand all Loading... |
74 "addDisallowedURL", | 78 "addDisallowedURL", |
75 "applicationCacheDiskUsageForOrigin" | 79 "applicationCacheDiskUsageForOrigin" |
76 ]; | 80 ]; |
77 for (var stub in stubs) { | 81 for (var stub in stubs) { |
78 Object.defineProperty(this, stub, {value: function() { return null; }}); | 82 Object.defineProperty(this, stub, {value: function() { return null; }}); |
79 } | 83 } |
80 } | 84 } |
81 TestRunner.prototype = DefaultHandler("testRunner"); | 85 TestRunner.prototype = DefaultHandler("testRunner"); |
82 testRunner = new TestRunner(); | 86 testRunner = new TestRunner(); |
83 })(); | 87 })(); |
OLD | NEW |