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 "base/strings/stringprintf.h" | 5 #include "base/strings/stringprintf.h" |
6 #include "extensions/renderer/module_system_test.h" | 6 #include "extensions/renderer/module_system_test.h" |
7 #include "gin/dictionary.h" | 7 #include "gin/dictionary.h" |
8 #include "grit/extensions_renderer_resources.h" | 8 #include "grit/extensions_renderer_resources.h" |
9 | 9 |
10 namespace extensions { | 10 namespace extensions { |
11 namespace { | 11 namespace { |
12 | 12 |
13 class UtilsUnittest : public ModuleSystemTest { | 13 class UtilsUnittest : public ModuleSystemTest { |
14 private: | 14 private: |
15 virtual void SetUp() OVERRIDE { | 15 virtual void SetUp() override { |
16 ModuleSystemTest::SetUp(); | 16 ModuleSystemTest::SetUp(); |
17 | 17 |
18 env()->RegisterModule("utils", IDR_UTILS_JS); | 18 env()->RegisterModule("utils", IDR_UTILS_JS); |
19 env()->RegisterTestFile("utils_unittest", "utils_unittest.js"); | 19 env()->RegisterTestFile("utils_unittest", "utils_unittest.js"); |
20 env()->OverrideNativeHandler("schema_registry", | 20 env()->OverrideNativeHandler("schema_registry", |
21 "exports.GetSchema = function() {};"); | 21 "exports.GetSchema = function() {};"); |
22 env()->OverrideNativeHandler("logging", | 22 env()->OverrideNativeHandler("logging", |
23 "exports.CHECK = function() {};\n" | 23 "exports.CHECK = function() {};\n" |
24 "exports.DCHECK = function() {};\n" | 24 "exports.DCHECK = function() {};\n" |
25 "exports.WARNING = function() {};"); | 25 "exports.WARNING = function() {};"); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 TEST_F(UtilsUnittest, PromiseError) { | 68 TEST_F(UtilsUnittest, PromiseError) { |
69 ModuleSystem::NativesEnabledScope natives_enabled_scope( | 69 ModuleSystem::NativesEnabledScope natives_enabled_scope( |
70 env()->module_system()); | 70 env()->module_system()); |
71 env()->module_system()->CallModuleMethod("utils_unittest", | 71 env()->module_system()->CallModuleMethod("utils_unittest", |
72 "testPromiseError"); | 72 "testPromiseError"); |
73 RunResolvedPromises(); | 73 RunResolvedPromises(); |
74 } | 74 } |
75 | 75 |
76 } // namespace | 76 } // namespace |
77 } // namespace extensions | 77 } // namespace extensions |
OLD | NEW |