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()); | |
77 ScriptStreamer::setSmallScriptThresholdForTesting(0); | 76 ScriptStreamer::setSmallScriptThresholdForTesting(0); |
78 } | 77 } |
79 | 78 |
80 ScriptState* scriptState() const { return m_scope.scriptState(); } | 79 ScriptState* scriptState() const { return m_scope.scriptState(); } |
81 v8::Isolate* isolate() const { return m_scope.isolate(); } | 80 v8::Isolate* isolate() const { return m_scope.isolate(); } |
82 | 81 |
83 PendingScript& pendingScript() const { return m_pendingScript->get(); } | 82 PendingScript& pendingScript() const { return m_pendingScript->get(); } |
84 | 83 |
85 protected: | 84 protected: |
86 void appendData(const char* data) | 85 void appendData(const char* data) |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 EXPECT_TRUE(sourceCode.streamer()); | 387 EXPECT_TRUE(sourceCode.streamer()); |
389 v8::TryCatch tryCatch; | 388 v8::TryCatch tryCatch; |
390 v8::Local<v8::Script> script; | 389 v8::Local<v8::Script> script; |
391 EXPECT_TRUE(V8ScriptRunner::compileScript(sourceCode, isolate()).ToLocal(&sc
ript)); | 390 EXPECT_TRUE(V8ScriptRunner::compileScript(sourceCode, isolate()).ToLocal(&sc
ript)); |
392 EXPECT_FALSE(tryCatch.HasCaught()); | 391 EXPECT_FALSE(tryCatch.HasCaught()); |
393 } | 392 } |
394 | 393 |
395 } // namespace | 394 } // namespace |
396 | 395 |
397 } // namespace blink | 396 } // namespace blink |
OLD | NEW |