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

Side by Side Diff: third_party/WebKit/Source/core/dom/ScriptRunnerTest.cpp

Issue 2260303002: Sending an async GET request for doc.written blocked scripts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test added, failed bot tests fixed, converted to enum. Created 4 years, 3 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "core/dom/ScriptRunner.h" 5 #include "core/dom/ScriptRunner.h"
6 6
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/dom/Element.h" 8 #include "core/dom/Element.h"
9 #include "core/dom/ScriptLoader.h" 9 #include "core/dom/ScriptLoader.h"
10 #include "platform/heap/Handle.h" 10 #include "platform/heap/Handle.h"
(...skipping 16 matching lines...) Expand all
27 public: 27 public:
28 static MockScriptLoader* create(Element* element) 28 static MockScriptLoader* create(Element* element)
29 { 29 {
30 return new MockScriptLoader(element); 30 return new MockScriptLoader(element);
31 } 31 }
32 ~MockScriptLoader() override { } 32 ~MockScriptLoader() override { }
33 33
34 MOCK_METHOD0(execute, void()); 34 MOCK_METHOD0(execute, void());
35 MOCK_CONST_METHOD0(isReady, bool()); 35 MOCK_CONST_METHOD0(isReady, bool());
36 private: 36 private:
37 explicit MockScriptLoader(Element* element) : ScriptLoader(element, false, f alse, false) 37 explicit MockScriptLoader(Element* element) : ScriptLoader(element, false, f alse, false, false)
38 { 38 {
39 } 39 }
40 }; 40 };
41 41
42 class ScriptRunnerTest : public testing::Test { 42 class ScriptRunnerTest : public testing::Test {
43 public: 43 public:
44 ScriptRunnerTest() 44 ScriptRunnerTest()
45 : m_document(Document::create()) 45 : m_document(Document::create())
46 , m_element(m_document->createElement("foo", ASSERT_NO_EXCEPTION)) 46 , m_element(m_document->createElement("foo", ASSERT_NO_EXCEPTION))
47 { 47 {
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 ThreadHeap::collectAllGarbage(); 440 ThreadHeap::collectAllGarbage();
441 441
442 // m_scriptRunner is gone. We need to make sure that ScriptRunner::Task do n ot access dead object. 442 // m_scriptRunner is gone. We need to make sure that ScriptRunner::Task do n ot access dead object.
443 EXPECT_CALL(*scriptLoader1, execute()).Times(0); 443 EXPECT_CALL(*scriptLoader1, execute()).Times(0);
444 EXPECT_CALL(*scriptLoader2, execute()).Times(0); 444 EXPECT_CALL(*scriptLoader2, execute()).Times(0);
445 445
446 m_platform.mockWebScheduler()->runAllTasks(); 446 m_platform.mockWebScheduler()->runAllTasks();
447 } 447 }
448 448
449 } // namespace blink 449 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698