| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/file_util.h" | 5 #include "base/file_util.h" |
| 6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "chrome/common/chrome_paths.h" | 8 #include "chrome/common/chrome_paths.h" |
| 9 #include "chrome/test/base/v8_unit_test.h" | 9 #include "chrome/test/base/v8_unit_test.h" |
| 10 #include "grit/renderer_resources.h" | 10 #include "grit/renderer_resources.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 // json_schema.js expects to have require() and requireNative() defined. | 30 // json_schema.js expects to have require() and requireNative() defined. |
| 31 ExecuteScriptInContext( | 31 ExecuteScriptInContext( |
| 32 "function requireNative(id) {" | 32 "function requireNative(id) {" |
| 33 " return {" | 33 " return {" |
| 34 " GetChromeHidden: function() { return {}; }," | 34 " GetChromeHidden: function() { return {}; }," |
| 35 " };" | 35 " };" |
| 36 "}" | 36 "}" |
| 37 "function require(id) {" | 37 "function require(id) {" |
| 38 " return {" | 38 " return {" |
| 39 " loadRefDependency: function(foo) { return {}; }," | 39 " loadRefType: function(foo) { return undefined; }," |
| 40 " };" | 40 " };" |
| 41 "}", | 41 "}", |
| 42 "test-code"); | 42 "test-code"); |
| 43 ExecuteScriptInContext(code, kJsonSchema); | 43 ExecuteScriptInContext(code, kJsonSchema); |
| 44 | 44 |
| 45 // Add the test functions to the context. | 45 // Add the test functions to the context. |
| 46 base::FilePath test_js_file_path; | 46 base::FilePath test_js_file_path; |
| 47 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_js_file_path)); | 47 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_js_file_path)); |
| 48 test_js_file_path = test_js_file_path.AppendASCII("extensions"); | 48 test_js_file_path = test_js_file_path.AppendASCII("extensions"); |
| 49 test_js_file_path = test_js_file_path.AppendASCII(kJsonSchemaTest); | 49 test_js_file_path = test_js_file_path.AppendASCII(kJsonSchemaTest); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 | 107 |
| 108 TEST_F(JsonSchemaTest, TestIsValidSchemaType) { | 108 TEST_F(JsonSchemaTest, TestIsValidSchemaType) { |
| 109 TestFunction("testIsValidSchemaType"); | 109 TestFunction("testIsValidSchemaType"); |
| 110 } | 110 } |
| 111 | 111 |
| 112 TEST_F(JsonSchemaTest, TestCheckSchemaOverlap) { | 112 TEST_F(JsonSchemaTest, TestCheckSchemaOverlap) { |
| 113 TestFunction("testCheckSchemaOverlap"); | 113 TestFunction("testCheckSchemaOverlap"); |
| 114 } | 114 } |
| 115 | 115 |
| 116 } // namespace extensions | 116 } // namespace extensions |
| OLD | NEW |