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

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

Issue 375243002: Move ModuleSystemTest and the tests that use it into extensions/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: namespace extensions Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/test/base/module_system_test.h" 5 #include "extensions/renderer/module_system_test.h"
6 6
7 namespace extensions { 7 namespace extensions {
8 namespace { 8 namespace {
9 9
10 class SafeBuiltinsUnittest : public ModuleSystemTest { 10 class SafeBuiltinsUnittest : public ModuleSystemTest {};
11 };
12 11
13 TEST_F(SafeBuiltinsUnittest, TestNotOriginalObject) { 12 TEST_F(SafeBuiltinsUnittest, TestNotOriginalObject) {
14 ModuleSystem::NativesEnabledScope natives_enabled_scope( 13 ModuleSystem::NativesEnabledScope natives_enabled_scope(
15 env()->module_system()); 14 env()->module_system());
16 env()->RegisterModule("test", 15 env()->RegisterModule("test",
17 "var assert = requireNative('assert');\n" 16 "var assert = requireNative('assert');\n"
18 "Array.foo = 10;\n" 17 "Array.foo = 10;\n"
19 "assert.AssertTrue(!$Array.hasOwnProperty('foo'));\n"); 18 "assert.AssertTrue(!$Array.hasOwnProperty('foo'));\n");
20 env()->module_system()->Require("test"); 19 env()->module_system()->Require("test");
21 } 20 }
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 "assert.AssertTrue(arr.length == 1);\n" 57 "assert.AssertTrue(arr.length == 1);\n"
59 "assert.AssertTrue(arr[0] == 1);\n"); 58 "assert.AssertTrue(arr[0] == 1);\n");
60 env()->module_system()->Require("test"); 59 env()->module_system()->Require("test");
61 } 60 }
62 61
63 // NOTE: JSON is already tested in ExtensionApiTest.Messaging, via 62 // NOTE: JSON is already tested in ExtensionApiTest.Messaging, via
64 // chrome/test/data/extensions/api_test/messaging/connect/page.js. 63 // chrome/test/data/extensions/api_test/messaging/connect/page.js.
65 64
66 } // namespace 65 } // namespace
67 } // namespace extensions 66 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698