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/ModuleScriptLoader.h" | 5 #include "core/loader/modulescript/ModuleScriptLoader.h" |
6 | 6 |
7 #include "bindings/core/v8/V8BindingForCore.h" | 7 #include "bindings/core/v8/V8BindingForCore.h" |
8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 RefPtr<SecurityOrigin> security_origin) | 57 RefPtr<SecurityOrigin> security_origin) |
58 : script_state_(std::move(script_state)), | 58 : script_state_(std::move(script_state)), |
59 security_origin_(std::move(security_origin)) {} | 59 security_origin_(std::move(security_origin)) {} |
60 | 60 |
61 ~ModuleScriptLoaderTestModulator() override {} | 61 ~ModuleScriptLoaderTestModulator() override {} |
62 | 62 |
63 SecurityOrigin* GetSecurityOrigin() override { | 63 SecurityOrigin* GetSecurityOrigin() override { |
64 return security_origin_.Get(); | 64 return security_origin_.Get(); |
65 } | 65 } |
66 | 66 |
67 ScriptModule CompileModule( | 67 ScriptModule CompileModule(const String& script, |
68 const String& script, | 68 const String& url_str, |
69 const String& url_str, | 69 AccessControlStatus access_control_status, |
70 AccessControlStatus access_control_status) override { | 70 const TextPosition& position) override { |
71 ScriptState::Scope scope(script_state_.Get()); | 71 ScriptState::Scope scope(script_state_.Get()); |
72 return ScriptModule::Compile(script_state_->GetIsolate(), | 72 return ScriptModule::Compile(script_state_->GetIsolate(), |
73 "export default 'foo';", "", | 73 "export default 'foo';", "", |
74 access_control_status); | 74 access_control_status); |
75 } | 75 } |
76 | 76 |
77 DECLARE_TRACE(); | 77 DECLARE_TRACE(); |
78 | 78 |
79 private: | 79 private: |
80 RefPtr<ScriptState> script_state_; | 80 RefPtr<ScriptState> script_state_; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 | 162 |
163 EXPECT_FALSE(client->WasNotifyFinished()) | 163 EXPECT_FALSE(client->WasNotifyFinished()) |
164 << "ModuleScriptLoader unexpectedly finished synchronously."; | 164 << "ModuleScriptLoader unexpectedly finished synchronously."; |
165 platform_->GetURLLoaderMockFactory()->ServeAsynchronousRequests(); | 165 platform_->GetURLLoaderMockFactory()->ServeAsynchronousRequests(); |
166 | 166 |
167 EXPECT_TRUE(client->WasNotifyFinished()); | 167 EXPECT_TRUE(client->WasNotifyFinished()); |
168 EXPECT_FALSE(client->GetModuleScript()); | 168 EXPECT_FALSE(client->GetModuleScript()); |
169 } | 169 } |
170 | 170 |
171 } // namespace blink | 171 } // namespace blink |
OLD | NEW |