| 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_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 { |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 TestFunction("testIntegerBounds"); | 72 TestFunction("testIntegerBounds"); |
| 73 } | 73 } |
| 74 | 74 |
| 75 TEST_F(JsonSchemaTest, TestType) { | 75 TEST_F(JsonSchemaTest, TestType) { |
| 76 gin::Dictionary array_buffer_container( | 76 gin::Dictionary array_buffer_container( |
| 77 env()->isolate(), | 77 env()->isolate(), |
| 78 env()->CreateGlobal("otherContextArrayBufferContainer")); | 78 env()->CreateGlobal("otherContextArrayBufferContainer")); |
| 79 { | 79 { |
| 80 // Create an ArrayBuffer in another v8 context and pass it to the test | 80 // Create an ArrayBuffer in another v8 context and pass it to the test |
| 81 // through a global. | 81 // through a global. |
| 82 scoped_ptr<ModuleSystemTestEnvironment> other_env(CreateEnvironment()); | 82 std::unique_ptr<ModuleSystemTestEnvironment> other_env(CreateEnvironment()); |
| 83 v8::Context::Scope scope(other_env->context()->v8_context()); | 83 v8::Context::Scope scope(other_env->context()->v8_context()); |
| 84 v8::Local<v8::ArrayBuffer> array_buffer( | 84 v8::Local<v8::ArrayBuffer> array_buffer( |
| 85 v8::ArrayBuffer::New(env()->isolate(), 1)); | 85 v8::ArrayBuffer::New(env()->isolate(), 1)); |
| 86 array_buffer_container.Set("value", array_buffer); | 86 array_buffer_container.Set("value", array_buffer); |
| 87 } | 87 } |
| 88 TestFunction("testType"); | 88 TestFunction("testType"); |
| 89 } | 89 } |
| 90 | 90 |
| 91 TEST_F(JsonSchemaTest, TestTypeReference) { | 91 TEST_F(JsonSchemaTest, TestTypeReference) { |
| 92 TestFunction("testTypeReference"); | 92 TestFunction("testTypeReference"); |
| 93 } | 93 } |
| 94 | 94 |
| 95 TEST_F(JsonSchemaTest, TestGetAllTypesForSchema) { | 95 TEST_F(JsonSchemaTest, TestGetAllTypesForSchema) { |
| 96 TestFunction("testGetAllTypesForSchema"); | 96 TestFunction("testGetAllTypesForSchema"); |
| 97 } | 97 } |
| 98 | 98 |
| 99 TEST_F(JsonSchemaTest, TestIsValidSchemaType) { | 99 TEST_F(JsonSchemaTest, TestIsValidSchemaType) { |
| 100 TestFunction("testIsValidSchemaType"); | 100 TestFunction("testIsValidSchemaType"); |
| 101 } | 101 } |
| 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 |
| OLD | NEW |