OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "use strict"; | 5 "use strict"; |
6 | 6 |
7 installClass("PrivateScriptTest", function(global, PrivateScriptTestPrototype) { | 7 installClass("PrivateScriptTest", function(PrivateScriptTestPrototype) { |
8 | 8 |
9 PrivateScriptTestPrototype.initialize = function() { | 9 PrivateScriptTestPrototype.initialize = function() { |
10 this.m_shortAttribute = -1; | 10 this.m_shortAttribute = -1; |
11 this.m_stringAttribute = "xxx"; | 11 this.m_stringAttribute = "xxx"; |
12 this.m_nodeAttribute = null; | 12 this.m_nodeAttribute = null; |
13 this.m_stringAttributeForPrivateScriptOnly = "yyy"; | 13 this.m_stringAttributeForPrivateScriptOnly = "yyy"; |
14 } | 14 } |
15 | 15 |
16 PrivateScriptTestPrototype.doNothing = function() { | 16 PrivateScriptTestPrototype.doNothing = function() { |
17 } | 17 } |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 node.innerHTML = string; | 84 node.innerHTML = string; |
85 } | 85 } |
86 | 86 |
87 PrivateScriptTestPrototype.addClickListener = function(node) { | 87 PrivateScriptTestPrototype.addClickListener = function(node) { |
88 node.addEventListener("click", function () { | 88 node.addEventListener("click", function () { |
89 node.innerHTML = "clicked"; | 89 node.innerHTML = "clicked"; |
90 }); | 90 }); |
91 } | 91 } |
92 | 92 |
93 PrivateScriptTestPrototype.clickNode = function(document, node) { | 93 PrivateScriptTestPrototype.clickNode = function(document, node) { |
94 var event = new MouseEvent("click", { bubbles: true, cancelable: true, v
iew: global }); | 94 var event = new MouseEvent("click", { bubbles: true, cancelable: true, v
iew: window }); |
95 node.dispatchEvent(event); | 95 node.dispatchEvent(event); |
96 } | 96 } |
97 | 97 |
98 Object.defineProperty(PrivateScriptTestPrototype, "readonlyShortAttribute",
{ | 98 Object.defineProperty(PrivateScriptTestPrototype, "readonlyShortAttribute",
{ |
99 get: function() { return 123; } | 99 get: function() { return 123; } |
100 }); | 100 }); |
101 | 101 |
102 Object.defineProperty(PrivateScriptTestPrototype, "shortAttribute", { | 102 Object.defineProperty(PrivateScriptTestPrototype, "shortAttribute", { |
103 get: function() { return this.m_shortAttribute; }, | 103 get: function() { return this.m_shortAttribute; }, |
104 set: function(value) { this.m_shortAttribute = value; } | 104 set: function(value) { this.m_shortAttribute = value; } |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 | 159 |
160 PrivateScriptTestPrototype.addIntegerImplementedInCPP = function(value1, val
ue2) { | 160 PrivateScriptTestPrototype.addIntegerImplementedInCPP = function(value1, val
ue2) { |
161 return this.addIntegerImplementedInCPPForPrivateScriptOnly(value1, value
2); | 161 return this.addIntegerImplementedInCPPForPrivateScriptOnly(value1, value
2); |
162 } | 162 } |
163 | 163 |
164 Object.defineProperty(PrivateScriptTestPrototype, "stringAttributeImplemente
dInCPP", { | 164 Object.defineProperty(PrivateScriptTestPrototype, "stringAttributeImplemente
dInCPP", { |
165 get: function() { return this.m_stringAttributeImplementedInCPPForPrivat
eScriptOnly; }, | 165 get: function() { return this.m_stringAttributeImplementedInCPPForPrivat
eScriptOnly; }, |
166 set: function(value) { this.m_stringAttributeImplementedInCPPForPrivateS
criptOnly = value; } | 166 set: function(value) { this.m_stringAttributeImplementedInCPPForPrivateS
criptOnly = value; } |
167 }); | 167 }); |
168 }); | 168 }); |
OLD | NEW |