| 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 ResourceRequest m_resourceRequest; | 124 ResourceRequest m_resourceRequest; |
| 125 ResourcePtr<ScriptResource> m_resource; | 125 ResourcePtr<ScriptResource> m_resource; |
| 126 OwnPtrWillBePersistent<PendingScriptWrapper> m_pendingScript; | 126 OwnPtrWillBePersistent<PendingScriptWrapper> m_pendingScript; |
| 127 }; | 127 }; |
| 128 | 128 |
| 129 class TestScriptResourceClient : public ScriptResourceClient { | 129 class TestScriptResourceClient : public ScriptResourceClient { |
| 130 public: | 130 public: |
| 131 TestScriptResourceClient() | 131 TestScriptResourceClient() |
| 132 : m_finished(false) { } | 132 : m_finished(false) { } |
| 133 | 133 |
| 134 virtual void notifyFinished(Resource*) override { m_finished = true; } | 134 void notifyFinished(Resource*) override { m_finished = true; } |
| 135 | 135 |
| 136 bool finished() const { return m_finished; } | 136 bool finished() const { return m_finished; } |
| 137 | 137 |
| 138 private: | 138 private: |
| 139 bool m_finished; | 139 bool m_finished; |
| 140 }; | 140 }; |
| 141 | 141 |
| 142 TEST_F(ScriptStreamingTest, CompilingStreamedScript) | 142 TEST_F(ScriptStreamingTest, CompilingStreamedScript) |
| 143 { | 143 { |
| 144 // Test that we can successfully compile a streamed script. | 144 // Test that we can successfully compile a streamed script. |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 EXPECT_TRUE(sourceCode.streamer()); | 384 EXPECT_TRUE(sourceCode.streamer()); |
| 385 v8::TryCatch tryCatch; | 385 v8::TryCatch tryCatch; |
| 386 v8::Local<v8::Script> script; | 386 v8::Local<v8::Script> script; |
| 387 EXPECT_TRUE(V8ScriptRunner::compileScript(sourceCode, isolate()).ToLocal(&sc
ript)); | 387 EXPECT_TRUE(V8ScriptRunner::compileScript(sourceCode, isolate()).ToLocal(&sc
ript)); |
| 388 EXPECT_FALSE(tryCatch.HasCaught()); | 388 EXPECT_FALSE(tryCatch.HasCaught()); |
| 389 } | 389 } |
| 390 | 390 |
| 391 } // namespace | 391 } // namespace |
| 392 | 392 |
| 393 } // namespace blink | 393 } // namespace blink |
| OLD | NEW |