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

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

Issue 2423043003: [Extensions] Convert some callers of ScriptContext::CallFunction (Closed)
Patch Set: d'oh Created 4 years, 2 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/extension_helper.cc ('k') | extensions/renderer/module_system.h » ('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_test.h" 5 #include "extensions/renderer/module_system_test.h"
6 #include "extensions/renderer/v8_schema_registry.h" 6 #include "extensions/renderer/v8_schema_registry.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 11
12 class JsonSchemaTest : public ModuleSystemTest { 12 class JsonSchemaTest : public ModuleSystemTest {
13 public: 13 public:
14 void SetUp() override { 14 void SetUp() override {
15 ModuleSystemTest::SetUp(); 15 ModuleSystemTest::SetUp();
16 16
17 env()->RegisterModule("json_schema", IDR_JSON_SCHEMA_JS); 17 env()->RegisterModule("json_schema", IDR_JSON_SCHEMA_JS);
18 env()->RegisterModule("utils", IDR_UTILS_JS); 18 env()->RegisterModule("utils", IDR_UTILS_JS);
19 19
20 env()->module_system()->RegisterNativeHandler( 20 env()->module_system()->RegisterNativeHandler(
21 "schema_registry", schema_registry_.AsNativeHandler()); 21 "schema_registry", schema_registry_.AsNativeHandler());
22 22
23 env()->RegisterTestFile("json_schema_test", "json_schema_test.js"); 23 env()->RegisterTestFile("json_schema_test", "json_schema_test.js");
24 } 24 }
25 25
26 protected: 26 protected:
27 void TestFunction(const std::string& test_name) { 27 void TestFunction(const std::string& test_name) {
28 env()->module_system()->CallModuleMethod("json_schema_test", test_name); 28 env()->module_system()->CallModuleMethodSafe("json_schema_test", test_name);
29 } 29 }
30 30
31 private: 31 private:
32 V8SchemaRegistry schema_registry_; 32 V8SchemaRegistry schema_registry_;
33 }; 33 };
34 34
35 TEST_F(JsonSchemaTest, TestFormatError) { 35 TEST_F(JsonSchemaTest, TestFormatError) {
36 TestFunction("testFormatError"); 36 TestFunction("testFormatError");
37 } 37 }
38 38
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 102
103 TEST_F(JsonSchemaTest, TestCheckSchemaOverlap) { 103 TEST_F(JsonSchemaTest, TestCheckSchemaOverlap) {
104 TestFunction("testCheckSchemaOverlap"); 104 TestFunction("testCheckSchemaOverlap");
105 } 105 }
106 106
107 TEST_F(JsonSchemaTest, TestInstanceOf) { 107 TEST_F(JsonSchemaTest, TestInstanceOf) {
108 TestFunction("testInstanceOf"); 108 TestFunction("testInstanceOf");
109 } 109 }
110 110
111 } // namespace extensions 111 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/extension_helper.cc ('k') | extensions/renderer/module_system.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698