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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 public: | 66 public: |
67 ScriptStreamingTest() | 67 ScriptStreamingTest() |
68 : m_loadingTaskRunner(Platform::current()->currentThread()->scheduler()-
>loadingTaskRunner()) | 68 : m_loadingTaskRunner(Platform::current()->currentThread()->scheduler()-
>loadingTaskRunner()) |
69 , m_scope(v8::Isolate::GetCurrent()) | 69 , m_scope(v8::Isolate::GetCurrent()) |
70 , m_settings(Settings::create()) | 70 , m_settings(Settings::create()) |
71 , m_resourceRequest("http://www.streaming-test.com/") | 71 , m_resourceRequest("http://www.streaming-test.com/") |
72 , m_resource(new ScriptResource(m_resourceRequest, "UTF-8")) | 72 , m_resource(new ScriptResource(m_resourceRequest, "UTF-8")) |
73 , m_pendingScript(PendingScriptWrapper::create(0, m_resource.get())) | 73 , m_pendingScript(PendingScriptWrapper::create(0, m_resource.get())) |
74 { | 74 { |
75 m_resource->setLoading(true); | 75 m_resource->setLoading(true); |
| 76 m_pendingScript = PendingScriptWrapper::create(0, m_resource.get()); |
76 ScriptStreamer::setSmallScriptThresholdForTesting(0); | 77 ScriptStreamer::setSmallScriptThresholdForTesting(0); |
77 } | 78 } |
78 | 79 |
79 ScriptState* scriptState() const { return m_scope.scriptState(); } | 80 ScriptState* scriptState() const { return m_scope.scriptState(); } |
80 v8::Isolate* isolate() const { return m_scope.isolate(); } | 81 v8::Isolate* isolate() const { return m_scope.isolate(); } |
81 | 82 |
82 PendingScript& pendingScript() const { return m_pendingScript->get(); } | 83 PendingScript& pendingScript() const { return m_pendingScript->get(); } |
83 | 84 |
84 protected: | 85 protected: |
85 void appendData(const char* data) | 86 void appendData(const char* data) |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 EXPECT_TRUE(sourceCode.streamer()); | 388 EXPECT_TRUE(sourceCode.streamer()); |
388 v8::TryCatch tryCatch; | 389 v8::TryCatch tryCatch; |
389 v8::Local<v8::Script> script; | 390 v8::Local<v8::Script> script; |
390 EXPECT_TRUE(V8ScriptRunner::compileScript(sourceCode, isolate()).ToLocal(&sc
ript)); | 391 EXPECT_TRUE(V8ScriptRunner::compileScript(sourceCode, isolate()).ToLocal(&sc
ript)); |
391 EXPECT_FALSE(tryCatch.HasCaught()); | 392 EXPECT_FALSE(tryCatch.HasCaught()); |
392 } | 393 } |
393 | 394 |
394 } // namespace | 395 } // namespace |
395 | 396 |
396 } // namespace blink | 397 } // namespace blink |
OLD | NEW |