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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp

Issue 1850413002: Improve DEFINE_STATIC_LOCAL()'s handling of Blink GCed objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address compilation failure Created 4 years, 8 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 #include "core/layout/LayoutTestHelper.h" 5 #include "core/layout/LayoutTestHelper.h"
6 6
7 #include "core/frame/FrameHost.h" 7 #include "core/frame/FrameHost.h"
8 #include "core/html/HTMLIFrameElement.h" 8 #include "core/html/HTMLIFrameElement.h"
9 #include "platform/scroll/ScrollbarTheme.h" 9 #include "platform/scroll/ScrollbarTheme.h"
10 10
11 namespace blink { 11 namespace blink {
12 12
13 RenderingTest::RenderingTest(RawPtr<FrameLoaderClient> frameLoaderClient) 13 RenderingTest::RenderingTest(RawPtr<FrameLoaderClient> frameLoaderClient)
14 : m_frameLoaderClient(frameLoaderClient) { } 14 : m_frameLoaderClient(frameLoaderClient) { }
15 15
16 void RenderingTest::SetUp() 16 void RenderingTest::SetUp()
17 { 17 {
18 Page::PageClients pageClients; 18 Page::PageClients pageClients;
19 fillWithEmptyClients(pageClients); 19 fillWithEmptyClients(pageClients);
20 DEFINE_STATIC_LOCAL(Persistent<EmptyChromeClient>, chromeClient, (EmptyChrom eClient::create())); 20 DEFINE_STATIC_LOCAL(EmptyChromeClient, chromeClient, (EmptyChromeClient::cre ate()));
21 pageClients.chromeClient = chromeClient.get(); 21 pageClients.chromeClient = &chromeClient;
22 m_pageHolder = DummyPageHolder::create(IntSize(800, 600), &pageClients, m_fr ameLoaderClient.release(), settingOverrider()); 22 m_pageHolder = DummyPageHolder::create(IntSize(800, 600), &pageClients, m_fr ameLoaderClient.release(), settingOverrider());
23 23
24 Settings::setMockScrollbarsEnabled(true); 24 Settings::setMockScrollbarsEnabled(true);
25 RuntimeEnabledFeatures::setOverlayScrollbarsEnabled(true); 25 RuntimeEnabledFeatures::setOverlayScrollbarsEnabled(true);
26 EXPECT_TRUE(ScrollbarTheme::theme().usesOverlayScrollbars()); 26 EXPECT_TRUE(ScrollbarTheme::theme().usesOverlayScrollbars());
27 27
28 // This ensures that the minimal DOM tree gets attached 28 // This ensures that the minimal DOM tree gets attached
29 // correctly for tests that don't call setBodyInnerHTML. 29 // correctly for tests that don't call setBodyInnerHTML.
30 document().view()->updateAllLifecyclePhases(); 30 document().view()->updateAllLifecyclePhases();
31 } 31 }
(...skipping 27 matching lines...) Expand all
59 static_cast<SingleChildFrameLoaderClient*>(document().frame()->client())->se tChild(m_subframe.get()); 59 static_cast<SingleChildFrameLoaderClient*>(document().frame()->client())->se tChild(m_subframe.get());
60 document().frame()->host()->incrementSubframeCount(); 60 document().frame()->host()->incrementSubframeCount();
61 Document& frameDocument = *iframe.contentDocument(); 61 Document& frameDocument = *iframe.contentDocument();
62 62
63 frameDocument.setBaseURLOverride(KURL(ParsedURLString, "http://test.com")); 63 frameDocument.setBaseURLOverride(KURL(ParsedURLString, "http://test.com"));
64 frameDocument.body()->setInnerHTML(htmlContentOfIframe, ASSERT_NO_EXCEPTION) ; 64 frameDocument.body()->setInnerHTML(htmlContentOfIframe, ASSERT_NO_EXCEPTION) ;
65 return frameDocument; 65 return frameDocument;
66 } 66 }
67 67
68 } // namespace blink 68 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698