OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 | 5 |
6 #include "config.h" | 6 #include "config.h" |
7 #include "bindings/core/v8/ScriptStreamer.h" | 7 #include "bindings/core/v8/ScriptStreamer.h" |
8 | 8 |
9 #include "bindings/core/v8/ScriptSourceCode.h" | 9 #include "bindings/core/v8/ScriptSourceCode.h" |
10 #include "bindings/core/v8/ScriptStreamerThread.h" | 10 #include "bindings/core/v8/ScriptStreamerThread.h" |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 ResourcePtr<ScriptResource> m_resource; | 129 ResourcePtr<ScriptResource> m_resource; |
130 OwnPtrWillBePersistent<PendingScriptWrapper> m_pendingScript; | 130 OwnPtrWillBePersistent<PendingScriptWrapper> m_pendingScript; |
131 }; | 131 }; |
132 | 132 |
133 class TestScriptResourceClient : public ScriptResourceClient { | 133 class TestScriptResourceClient : public ScriptResourceClient { |
134 public: | 134 public: |
135 TestScriptResourceClient() | 135 TestScriptResourceClient() |
136 : m_finished(false) { } | 136 : m_finished(false) { } |
137 | 137 |
138 void notifyFinished(Resource*) override { m_finished = true; } | 138 void notifyFinished(Resource*) override { m_finished = true; } |
| 139 String debugName() const override { return "TestScriptResourceClient"; } |
139 | 140 |
140 bool finished() const { return m_finished; } | 141 bool finished() const { return m_finished; } |
141 | 142 |
142 private: | 143 private: |
143 bool m_finished; | 144 bool m_finished; |
144 }; | 145 }; |
145 | 146 |
146 TEST_F(ScriptStreamingTest, CompilingStreamedScript) | 147 TEST_F(ScriptStreamingTest, CompilingStreamedScript) |
147 { | 148 { |
148 // Test that we can successfully compile a streamed script. | 149 // Test that we can successfully compile a streamed script. |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 EXPECT_TRUE(sourceCode.streamer()); | 389 EXPECT_TRUE(sourceCode.streamer()); |
389 v8::TryCatch tryCatch; | 390 v8::TryCatch tryCatch; |
390 v8::Local<v8::Script> script; | 391 v8::Local<v8::Script> script; |
391 EXPECT_TRUE(V8ScriptRunner::compileScript(sourceCode, isolate()).ToLocal(&sc
ript)); | 392 EXPECT_TRUE(V8ScriptRunner::compileScript(sourceCode, isolate()).ToLocal(&sc
ript)); |
392 EXPECT_FALSE(tryCatch.HasCaught()); | 393 EXPECT_FALSE(tryCatch.HasCaught()); |
393 } | 394 } |
394 | 395 |
395 } // namespace | 396 } // namespace |
396 | 397 |
397 } // namespace blink | 398 } // namespace blink |
OLD | NEW |