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

Unified Diff: extensions/test/data/utils_unittest.js

Issue 1938123002: Ensure that privates are private. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 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
« no previous file with comments | « extensions/renderer/utils_native_handler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/test/data/utils_unittest.js
diff --git a/extensions/test/data/utils_unittest.js b/extensions/test/data/utils_unittest.js
index 1ecc42147a3ef7589ba2b18d5dcc30194cc85206..64adec410ed85bf56e9c38fab53c5eee80d12846 100644
--- a/extensions/test/data/utils_unittest.js
+++ b/extensions/test/data/utils_unittest.js
@@ -29,16 +29,22 @@ function testSuperClass() {
subFunc: function() { return 'subFunc'; }
};
- var SuperClass = utils.expose('SuperClass',
- SuperClassImpl,
- { functions: ['func', 'superFunc'],
- properties: ['attrA', 'attrB'] });
+ function SuperClass() {
+ privates(SuperClass).constructPrivate(this, arguments);
+ }
+ utils.expose(SuperClass, SuperClassImpl, {
+ functions: ['func', 'superFunc'],
+ properties: ['attrA', 'attrB'],
+ });
- var SubClass = utils.expose('SubClass',
- SubClassImpl,
- { superclass: SuperClass,
- functions: ['subFunc'],
- properties: ['attrC'] });
+ function SubClass() {
+ privates(SubClass).constructPrivate(this, arguments);
+ }
+ utils.expose(SubClass, SubClassImpl, {
+ superclass: SuperClass,
+ functions: ['subFunc'],
+ properties: ['attrC'],
+ });
var supe = new SuperClass();
AssertTrue(supe.attrA == 'aSuper');
@@ -63,12 +69,16 @@ function testSuperClass() {
function SubSubClassImpl() {}
SubSubClassImpl.prototype = Object.create(SubClassImpl.prototype);
- SubSubClassImpl.prototype.subSubFunc = function() { return 'subsub'; }
+ SubSubClassImpl.prototype.subSubFunc = function() { return 'subsub'; };
+
+ function SubSubClass() {
+ privates(SubSubClass).constructPrivate(this, arguments);
+ }
+ utils.expose(SubSubClass, SubSubClassImpl, {
+ superclass: SubClass,
+ functions: ['subSubFunc'],
+ });
- var SubSubClass = utils.expose('SubSubClass',
- SubSubClassImpl,
- { superclass: SubClass,
- functions: ['subSubFunc'] });
var subsub = new SubSubClass();
AssertTrue(subsub.attrA == 'aSub');
AssertTrue(subsub.attrB == 'bSuper');
« no previous file with comments | « extensions/renderer/utils_native_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698