Index: third_party/WebKit/Source/core/dom/ScriptRunnerTest.cpp |
diff --git a/third_party/WebKit/Source/core/dom/ScriptRunnerTest.cpp b/third_party/WebKit/Source/core/dom/ScriptRunnerTest.cpp |
index 301b6deccf379dc2bc3751ff3390747a3984d936..869f189ed7ce52e7da5982ebd77342f854abe8c6 100644 |
--- a/third_party/WebKit/Source/core/dom/ScriptRunnerTest.cpp |
+++ b/third_party/WebKit/Source/core/dom/ScriptRunnerTest.cpp |
@@ -104,6 +104,12 @@ public: |
void cryptographicallyRandomValues(unsigned char* buffer, size_t length) override { } |
+ const unsigned char* getTraceCategoryEnabledFlag(const char* categoryName) override |
+ { |
+ static const unsigned char tracingIsDisabled = 0; |
+ return &tracingIsDisabled; |
+ } |
+ |
WebThread* currentThread() override { return &m_mockWebThread; } |
WebTaskRunner* loadingTaskRunner() override |
@@ -524,8 +530,8 @@ TEST_F(ScriptRunnerTest, LateNotifications) |
TEST_F(ScriptRunnerTest, TasksWithDeadScriptRunner) |
{ |
- OwnPtrWillBeRawPtr<MockScriptLoader> scriptLoader1 = MockScriptLoader::create(m_element.get()); |
- OwnPtrWillBeRawPtr<MockScriptLoader> scriptLoader2 = MockScriptLoader::create(m_element.get()); |
+ OwnPtrWillBePersistent<MockScriptLoader> scriptLoader1 = MockScriptLoader::create(m_element.get()); |
+ OwnPtrWillBePersistent<MockScriptLoader> scriptLoader2 = MockScriptLoader::create(m_element.get()); |
EXPECT_CALL(*scriptLoader1, isReady()).WillRepeatedly(Return(true)); |
EXPECT_CALL(*scriptLoader2, isReady()).WillRepeatedly(Return(true)); |
@@ -538,6 +544,10 @@ TEST_F(ScriptRunnerTest, TasksWithDeadScriptRunner) |
m_scriptRunner.release(); |
+#if ENABLE(OILPAN) |
+ Heap::collectAllGarbage(); |
+#endif |
+ |
// m_scriptRunner is gone. We need to make sure that ScriptRunner::Task do not access dead object. |
EXPECT_CALL(*scriptLoader1, execute()).Times(0); |
EXPECT_CALL(*scriptLoader2, execute()).Times(0); |