| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "core/dom/ScriptModuleResolverImpl.h" | 5 #include "core/dom/ScriptModuleResolverImpl.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/V8BindingForTesting.h" | 7 #include "bindings/core/v8/V8BindingForTesting.h" |
| 8 #include "core/dom/ExceptionCode.h" | 8 #include "core/dom/ExceptionCode.h" |
| 9 #include "core/dom/Modulator.h" | 9 #include "core/dom/Modulator.h" |
| 10 #include "core/dom/ModuleScript.h" | 10 #include "core/dom/ModuleScript.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 v8::Local<v8::Value> error = | 103 v8::Local<v8::Value> error = |
| 104 V8ThrowException::CreateError(scope.GetIsolate(), "hoge"); | 104 V8ThrowException::CreateError(scope.GetIsolate(), "hoge"); |
| 105 module_script->SetErrorAndClearRecord( | 105 module_script->SetErrorAndClearRecord( |
| 106 ScriptValue(scope.GetScriptState(), error)); | 106 ScriptValue(scope.GetScriptState(), error)); |
| 107 } | 107 } |
| 108 return module_script; | 108 return module_script; |
| 109 } | 109 } |
| 110 | 110 |
| 111 } // namespace | 111 } // namespace |
| 112 | 112 |
| 113 class ScriptModuleResolverImplTest : public testing::Test { | 113 class ScriptModuleResolverImplTest : public ::testing::Test { |
| 114 public: | 114 public: |
| 115 void SetUp() override; | 115 void SetUp() override; |
| 116 | 116 |
| 117 ScriptModuleResolverImplTestModulator* Modulator() { | 117 ScriptModuleResolverImplTestModulator* Modulator() { |
| 118 return modulator_.Get(); | 118 return modulator_.Get(); |
| 119 } | 119 } |
| 120 | 120 |
| 121 protected: | 121 protected: |
| 122 ScopedTestingPlatformSupport<TestingPlatformSupportWithMockScheduler> | 122 ScopedTestingPlatformSupport<TestingPlatformSupportWithMockScheduler> |
| 123 platform_; | 123 platform_; |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 scope.GetExceptionState()); | 221 scope.GetExceptionState()); |
| 222 EXPECT_TRUE(scope.GetExceptionState().HadException()); | 222 EXPECT_TRUE(scope.GetExceptionState().HadException()); |
| 223 EXPECT_EQ(kUnknownError, scope.GetExceptionState().Code()); | 223 EXPECT_EQ(kUnknownError, scope.GetExceptionState().Code()); |
| 224 EXPECT_TRUE(resolved.IsNull()); | 224 EXPECT_TRUE(resolved.IsNull()); |
| 225 EXPECT_EQ(1, modulator_->GetFetchedModuleScriptCalled()); | 225 EXPECT_EQ(1, modulator_->GetFetchedModuleScriptCalled()); |
| 226 EXPECT_EQ(modulator_->FetchedUrl(), target_module_script->BaseURL()) | 226 EXPECT_EQ(modulator_->FetchedUrl(), target_module_script->BaseURL()) |
| 227 << "Unexpectedly fetched URL: " << modulator_->FetchedUrl().GetString(); | 227 << "Unexpectedly fetched URL: " << modulator_->FetchedUrl().GetString(); |
| 228 } | 228 } |
| 229 | 229 |
| 230 } // namespace blink | 230 } // namespace blink |
| OLD | NEW |