| 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/loader/modulescript/ModuleTreeLinker.h" | 5 #include "core/loader/modulescript/ModuleTreeLinker.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ScriptModule.h" | 7 #include "bindings/core/v8/ScriptModule.h" |
| 8 #include "bindings/core/v8/V8BindingForCore.h" | 8 #include "bindings/core/v8/V8BindingForCore.h" |
| 9 #include "bindings/core/v8/V8BindingForTesting.h" | 9 #include "bindings/core/v8/V8BindingForTesting.h" |
| 10 #include "core/dom/Modulator.h" | 10 #include "core/dom/Modulator.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 EXPECT_TRUE(result_map.is_new_entry); | 139 EXPECT_TRUE(result_map.is_new_entry); |
| 140 | 140 |
| 141 pending_client->NotifyModuleTreeLoadFinished(module_script); | 141 pending_client->NotifyModuleTreeLoadFinished(module_script); |
| 142 } | 142 } |
| 143 | 143 |
| 144 void SetInstantiateShouldFail(bool b) { instantiate_should_fail_ = b; } | 144 void SetInstantiateShouldFail(bool b) { instantiate_should_fail_ = b; } |
| 145 | 145 |
| 146 private: | 146 private: |
| 147 // Implements Modulator: | 147 // Implements Modulator: |
| 148 | 148 |
| 149 ScriptState* GetScriptState() override { return script_state_.Get(); } |
| 150 |
| 149 void FetchSingle(const ModuleScriptFetchRequest& request, | 151 void FetchSingle(const ModuleScriptFetchRequest& request, |
| 150 ModuleGraphLevel, | 152 ModuleGraphLevel, |
| 151 SingleModuleClient* client) override { | 153 SingleModuleClient* client) override { |
| 152 pending_request_url_ = request.Url(); | 154 pending_request_url_ = request.Url(); |
| 153 EXPECT_FALSE(pending_client_); | 155 EXPECT_FALSE(pending_client_); |
| 154 pending_client_ = client; | 156 pending_client_ = client; |
| 155 } | 157 } |
| 156 | 158 |
| 157 void FetchTreeInternal(const ModuleScriptFetchRequest& request, | 159 void FetchTreeInternal(const ModuleScriptFetchRequest& request, |
| 158 const AncestorList& list, | 160 const AncestorList& list, |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 auto ancestor_list = GetModulator()->GetAncestorListForTreeFetch(url); | 527 auto ancestor_list = GetModulator()->GetAncestorListForTreeFetch(url); |
| 526 EXPECT_EQ(0u, ancestor_list.size()); | 528 EXPECT_EQ(0u, ancestor_list.size()); |
| 527 | 529 |
| 528 EXPECT_TRUE(client->WasNotifyFinished()); | 530 EXPECT_TRUE(client->WasNotifyFinished()); |
| 529 ASSERT_TRUE(client->GetModuleScript()); | 531 ASSERT_TRUE(client->GetModuleScript()); |
| 530 EXPECT_EQ(client->GetModuleScript()->InstantiationState(), | 532 EXPECT_EQ(client->GetModuleScript()->InstantiationState(), |
| 531 ModuleInstantiationState::kInstantiated); | 533 ModuleInstantiationState::kInstantiated); |
| 532 } | 534 } |
| 533 | 535 |
| 534 } // namespace blink | 536 } // namespace blink |
| OLD | NEW |