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

Side by Side Diff: extensions/renderer/module_system_unittest.cc

Issue 1938123002: Ensure that privates are private. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « extensions/renderer/module_system.cc ('k') | extensions/renderer/resources/event.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "extensions/renderer/module_system.h" 5 #include "extensions/renderer/module_system.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 scoped_ptr<ModuleSystemTestEnvironment> other_env = CreateEnvironment(); 498 scoped_ptr<ModuleSystemTestEnvironment> other_env = CreateEnvironment();
499 gin::ModuleRegistry::From(env()->context()->v8_context()) 499 gin::ModuleRegistry::From(env()->context()->v8_context())
500 ->AddBuiltinModule( 500 ->AddBuiltinModule(
501 env()->isolate(), "natives", 501 env()->isolate(), "natives",
502 other_env->module_system()->NewInstance()); 502 other_env->module_system()->NewInstance());
503 other_env->ShutdownModuleSystem(); 503 other_env->ShutdownModuleSystem();
504 env()->module_system()->Require("test"); 504 env()->module_system()->Require("test");
505 RunResolvedPromises(); 505 RunResolvedPromises();
506 } 506 }
507 507
508 TEST_F(ModuleSystemTest, TestPrivatesIsPrivate) {
509 ModuleSystem::NativesEnabledScope natives_enabled_scope(
510 env()->module_system());
511 env()->RegisterModule(
512 "test",
513 "var v = privates({});"
514 "requireNative('assert').AssertFalse(v instanceof Object);");
515 env()->module_system()->Require("test");
516 }
517
508 } // namespace extensions 518 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/module_system.cc ('k') | extensions/renderer/resources/event.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698