Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: third_party/WebKit/Source/core/dom/ModuleMapTest.cpp

Issue 2845743003: Move "create a module script" from ModuleScriptLoader to ModuleScript (Closed)
Patch Set: Rebase Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/ModuleScript.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 ModuleScriptLoaderClient* client) { 124 ModuleScriptLoaderClient* client) {
125 TestRequest* test_request = new TestRequest; 125 TestRequest* test_request = new TestRequest;
126 test_request->url = request.Url(); 126 test_request->url = request.Url();
127 test_request->nonce = request.Nonce(); 127 test_request->nonce = request.Nonce();
128 test_request->client = client; 128 test_request->client = client;
129 test_requests_.push_back(test_request); 129 test_requests_.push_back(test_request);
130 } 130 }
131 131
132 void ModuleMapTestModulator::ResolveFetches() { 132 void ModuleMapTestModulator::ResolveFetches() {
133 for (const auto& test_request : test_requests_) { 133 for (const auto& test_request : test_requests_) {
134 ModuleScript* module_script = ModuleScript::Create( 134 ModuleScript* module_script = ModuleScript::CreateForTest(
135 this, ScriptModule(), test_request->url, test_request->nonce, 135 this, ScriptModule(), test_request->url, test_request->nonce,
136 kParserInserted, WebURLRequest::kFetchCredentialsModeOmit); 136 kParserInserted, WebURLRequest::kFetchCredentialsModeOmit);
137 TaskRunner()->PostTask( 137 TaskRunner()->PostTask(
138 BLINK_FROM_HERE, 138 BLINK_FROM_HERE,
139 WTF::Bind(&ModuleScriptLoaderClient::NotifyNewSingleModuleFinished, 139 WTF::Bind(&ModuleScriptLoaderClient::NotifyNewSingleModuleFinished,
140 WrapPersistent(test_request->client.Get()), 140 WrapPersistent(test_request->client.Get()),
141 WrapPersistent(module_script))); 141 WrapPersistent(module_script)));
142 } 142 }
143 test_requests_.clear(); 143 test_requests_.clear();
144 } 144 }
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 EXPECT_TRUE(client->GetModuleScript()); 242 EXPECT_TRUE(client->GetModuleScript());
243 EXPECT_EQ(client->GetModuleScript()->InstantiationState(), 243 EXPECT_EQ(client->GetModuleScript()->InstantiationState(),
244 ModuleInstantiationState::kUninstantiated); 244 ModuleInstantiationState::kUninstantiated);
245 EXPECT_TRUE(client2->WasNotifyFinished()); 245 EXPECT_TRUE(client2->WasNotifyFinished());
246 EXPECT_TRUE(client2->GetModuleScript()); 246 EXPECT_TRUE(client2->GetModuleScript());
247 EXPECT_EQ(client2->GetModuleScript()->InstantiationState(), 247 EXPECT_EQ(client2->GetModuleScript()->InstantiationState(),
248 ModuleInstantiationState::kUninstantiated); 248 ModuleInstantiationState::kUninstantiated);
249 } 249 }
250 250
251 } // namespace blink 251 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/ModuleScript.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698