Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp

Issue 1398523004: Revalidate using the same Resource, attempt #3 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.cpp ('k') | third_party/WebKit/Source/core/fetch/FontResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698