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/ModuleMap.h" | 5 #include "core/dom/ModuleMap.h" |
6 | 6 |
7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
8 #include "core/dom/Modulator.h" | 8 #include "core/dom/Modulator.h" |
9 #include "core/dom/ModuleScript.h" | 9 #include "core/dom/ModuleScript.h" |
10 #include "core/dom/ScriptModuleResolver.h" | 10 #include "core/dom/ScriptModuleResolver.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 kParserInserted, WebURLRequest::kFetchCredentialsModeOmit); | 139 kParserInserted, WebURLRequest::kFetchCredentialsModeOmit); |
140 TaskRunner()->PostTask( | 140 TaskRunner()->PostTask( |
141 BLINK_FROM_HERE, | 141 BLINK_FROM_HERE, |
142 WTF::Bind(&ModuleScriptLoaderClient::NotifyNewSingleModuleFinished, | 142 WTF::Bind(&ModuleScriptLoaderClient::NotifyNewSingleModuleFinished, |
143 WrapPersistent(test_request->client.Get()), | 143 WrapPersistent(test_request->client.Get()), |
144 WrapPersistent(module_script))); | 144 WrapPersistent(module_script))); |
145 } | 145 } |
146 test_requests_.clear(); | 146 test_requests_.clear(); |
147 } | 147 } |
148 | 148 |
149 class ModuleMapTest : public testing::Test { | 149 class ModuleMapTest : public ::testing::Test { |
150 public: | 150 public: |
151 void SetUp() override; | 151 void SetUp() override; |
152 | 152 |
153 ModuleMapTestModulator* Modulator() { return modulator_.Get(); } | 153 ModuleMapTestModulator* Modulator() { return modulator_.Get(); } |
154 ModuleMap* Map() { return map_; } | 154 ModuleMap* Map() { return map_; } |
155 | 155 |
156 protected: | 156 protected: |
157 Persistent<ModuleMapTestModulator> modulator_; | 157 Persistent<ModuleMapTestModulator> modulator_; |
158 Persistent<ModuleMap> map_; | 158 Persistent<ModuleMap> map_; |
159 }; | 159 }; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 | 241 |
242 EXPECT_TRUE(client->WasNotifyFinished()); | 242 EXPECT_TRUE(client->WasNotifyFinished()); |
243 EXPECT_TRUE(client->GetModuleScript()); | 243 EXPECT_TRUE(client->GetModuleScript()); |
244 EXPECT_FALSE(client->GetModuleScript()->HasInstantiated()); | 244 EXPECT_FALSE(client->GetModuleScript()->HasInstantiated()); |
245 EXPECT_TRUE(client2->WasNotifyFinished()); | 245 EXPECT_TRUE(client2->WasNotifyFinished()); |
246 EXPECT_TRUE(client2->GetModuleScript()); | 246 EXPECT_TRUE(client2->GetModuleScript()); |
247 EXPECT_FALSE(client2->GetModuleScript()->HasInstantiated()); | 247 EXPECT_FALSE(client2->GetModuleScript()->HasInstantiated()); |
248 } | 248 } |
249 | 249 |
250 } // namespace blink | 250 } // namespace blink |
OLD | NEW |