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 #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 Loading... |
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 |
OLD | NEW |