| 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 #include "bindings/core/v8/ScriptStreamer.h" | 5 #include "bindings/core/v8/ScriptStreamer.h" | 
| 6 | 6 | 
| 7 #include "bindings/core/v8/ScriptSourceCode.h" | 7 #include "bindings/core/v8/ScriptSourceCode.h" | 
| 8 #include "bindings/core/v8/ScriptStreamerThread.h" | 8 #include "bindings/core/v8/ScriptStreamerThread.h" | 
| 9 #include "bindings/core/v8/V8Binding.h" | 9 #include "bindings/core/v8/V8Binding.h" | 
| 10 #include "bindings/core/v8/V8BindingForTesting.h" | 10 #include "bindings/core/v8/V8BindingForTesting.h" | 
| (...skipping 16 matching lines...) Expand all  Loading... | 
| 27 class ScriptStreamingTest : public ::testing::Test { | 27 class ScriptStreamingTest : public ::testing::Test { | 
| 28  public: | 28  public: | 
| 29   ScriptStreamingTest() | 29   ScriptStreamingTest() | 
| 30       : m_loadingTaskRunner(Platform::current() | 30       : m_loadingTaskRunner(Platform::current() | 
| 31                                 ->currentThread() | 31                                 ->currentThread() | 
| 32                                 ->scheduler() | 32                                 ->scheduler() | 
| 33                                 ->loadingTaskRunner()), | 33                                 ->loadingTaskRunner()), | 
| 34         m_settings(Settings::create()), | 34         m_settings(Settings::create()), | 
| 35         m_resourceRequest("http://www.streaming-test.com/"), | 35         m_resourceRequest("http://www.streaming-test.com/"), | 
| 36         m_resource(ScriptResource::create(m_resourceRequest, "UTF-8")), | 36         m_resource(ScriptResource::create(m_resourceRequest, "UTF-8")), | 
| 37         m_pendingScript(PendingScript::create(0, m_resource.get())) { | 37         m_pendingScript(PendingScript::createForTesting(m_resource.get())) { | 
| 38     m_resource->setStatus(ResourceStatus::Pending); | 38     m_resource->setStatus(ResourceStatus::Pending); | 
| 39     m_pendingScript = PendingScript::create(0, m_resource.get()); | 39     m_pendingScript = PendingScript::createForTesting(m_resource.get()); | 
| 40     ScriptStreamer::setSmallScriptThresholdForTesting(0); | 40     ScriptStreamer::setSmallScriptThresholdForTesting(0); | 
| 41   } | 41   } | 
| 42 | 42 | 
| 43   ~ScriptStreamingTest() { | 43   ~ScriptStreamingTest() { | 
| 44     if (m_pendingScript) | 44     if (m_pendingScript) | 
| 45       m_pendingScript->dispose(); | 45       m_pendingScript->dispose(); | 
| 46   } | 46   } | 
| 47 | 47 | 
| 48   PendingScript* getPendingScript() const { return m_pendingScript.get(); } | 48   PendingScript* getPendingScript() const { return m_pendingScript.get(); } | 
| 49 | 49 | 
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 385   v8::TryCatch tryCatch(scope.isolate()); | 385   v8::TryCatch tryCatch(scope.isolate()); | 
| 386   v8::Local<v8::Script> script; | 386   v8::Local<v8::Script> script; | 
| 387   EXPECT_TRUE(V8ScriptRunner::compileScript(sourceCode, scope.isolate()) | 387   EXPECT_TRUE(V8ScriptRunner::compileScript(sourceCode, scope.isolate()) | 
| 388                   .ToLocal(&script)); | 388                   .ToLocal(&script)); | 
| 389   EXPECT_FALSE(tryCatch.HasCaught()); | 389   EXPECT_FALSE(tryCatch.HasCaught()); | 
| 390 } | 390 } | 
| 391 | 391 | 
| 392 }  // namespace | 392 }  // namespace | 
| 393 | 393 | 
| 394 }  // namespace blink | 394 }  // namespace blink | 
| OLD | NEW | 
|---|