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

Side by Side Diff: Source/web/tests/WebFrameTest.cpp

Issue 438843004: Move the user agent styles sheets to blink_resources.grd (Part 3) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removed header inclusion. Created 6 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 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 16 matching lines...) Expand all
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #include "config.h" 31 #include "config.h"
32 32
33 #include "public/web/WebFrame.h" 33 #include "public/web/WebFrame.h"
34 34
35 #include "SkBitmap.h" 35 #include "SkBitmap.h"
36 #include "SkCanvas.h" 36 #include "SkCanvas.h"
37 #include "core/UserAgentStyleSheets.h"
38 #include "core/clipboard/DataTransfer.h" 37 #include "core/clipboard/DataTransfer.h"
39 #include "core/css/StyleSheetContents.h" 38 #include "core/css/StyleSheetContents.h"
40 #include "core/css/resolver/StyleResolver.h" 39 #include "core/css/resolver/StyleResolver.h"
41 #include "core/css/resolver/ViewportStyleResolver.h" 40 #include "core/css/resolver/ViewportStyleResolver.h"
42 #include "core/dom/DocumentMarkerController.h" 41 #include "core/dom/DocumentMarkerController.h"
43 #include "core/dom/Fullscreen.h" 42 #include "core/dom/Fullscreen.h"
44 #include "core/dom/NodeRenderStyle.h" 43 #include "core/dom/NodeRenderStyle.h"
45 #include "core/dom/Range.h" 44 #include "core/dom/Range.h"
46 #include "core/editing/Editor.h" 45 #include "core/editing/Editor.h"
47 #include "core/editing/FrameSelection.h" 46 #include "core/editing/FrameSelection.h"
(...skipping 10 matching lines...) Expand all
58 #include "core/loader/DocumentThreadableLoaderClient.h" 57 #include "core/loader/DocumentThreadableLoaderClient.h"
59 #include "core/loader/FrameLoadRequest.h" 58 #include "core/loader/FrameLoadRequest.h"
60 #include "core/loader/ThreadableLoader.h" 59 #include "core/loader/ThreadableLoader.h"
61 #include "core/page/EventHandler.h" 60 #include "core/page/EventHandler.h"
62 #include "core/page/Page.h" 61 #include "core/page/Page.h"
63 #include "core/rendering/HitTestResult.h" 62 #include "core/rendering/HitTestResult.h"
64 #include "core/rendering/RenderView.h" 63 #include "core/rendering/RenderView.h"
65 #include "core/rendering/compositing/RenderLayerCompositor.h" 64 #include "core/rendering/compositing/RenderLayerCompositor.h"
66 #include "core/testing/URLTestHelpers.h" 65 #include "core/testing/URLTestHelpers.h"
67 #include "platform/DragImage.h" 66 #include "platform/DragImage.h"
67 #include "platform/PlatformResourceLoader.h"
68 #include "platform/RuntimeEnabledFeatures.h" 68 #include "platform/RuntimeEnabledFeatures.h"
69 #include "platform/UserGestureIndicator.h" 69 #include "platform/UserGestureIndicator.h"
70 #include "platform/geometry/FloatRect.h" 70 #include "platform/geometry/FloatRect.h"
71 #include "platform/network/ResourceError.h" 71 #include "platform/network/ResourceError.h"
72 #include "platform/scroll/ScrollbarTheme.h" 72 #include "platform/scroll/ScrollbarTheme.h"
73 #include "platform/weborigin/SchemeRegistry.h" 73 #include "platform/weborigin/SchemeRegistry.h"
74 #include "public/platform/Platform.h" 74 #include "public/platform/Platform.h"
75 #include "public/platform/WebFloatRect.h" 75 #include "public/platform/WebFloatRect.h"
76 #include "public/platform/WebSelectionBound.h" 76 #include "public/platform/WebSelectionBound.h"
77 #include "public/platform/WebThread.h" 77 #include "public/platform/WebThread.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 } 151 }
152 152
153 void registerMockedChromeURLLoad(const std::string& fileName) 153 void registerMockedChromeURLLoad(const std::string& fileName)
154 { 154 {
155 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_chrom eURL.c_str()), WebString::fromUTF8(fileName.c_str())); 155 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_chrom eURL.c_str()), WebString::fromUTF8(fileName.c_str()));
156 } 156 }
157 157
158 void applyViewportStyleOverride(FrameTestHelpers::WebViewHelper* webViewHelp er) 158 void applyViewportStyleOverride(FrameTestHelpers::WebViewHelper* webViewHelp er)
159 { 159 {
160 RefPtrWillBeRawPtr<blink::StyleSheetContents> styleSheet = blink::StyleS heetContents::create(blink::CSSParserContext(blink::UASheetMode, 0)); 160 RefPtrWillBeRawPtr<blink::StyleSheetContents> styleSheet = blink::StyleS heetContents::create(blink::CSSParserContext(blink::UASheetMode, 0));
161 styleSheet->parseString(String(blink::viewportAndroidCss, sizeof(blink:: viewportAndroidCss))); 161 styleSheet->parseString(loadResourceAsASCIIString("viewportAndroid.css") );
162 OwnPtrWillBeRawPtr<blink::RuleSet> ruleSet = blink::RuleSet::create(); 162 OwnPtrWillBeRawPtr<blink::RuleSet> ruleSet = blink::RuleSet::create();
163 ruleSet->addRulesFromSheet(styleSheet.get(), blink::MediaQueryEvaluator( "screen")); 163 ruleSet->addRulesFromSheet(styleSheet.get(), blink::MediaQueryEvaluator( "screen"));
164 164
165 Document* document = toLocalFrame(webViewHelper->webViewImpl()->page()-> mainFrame())->document(); 165 Document* document = toLocalFrame(webViewHelper->webViewImpl()->page()-> mainFrame())->document();
166 document->ensureStyleResolver().viewportStyleResolver()->collectViewport Rules(ruleSet.get(), blink::ViewportStyleResolver::UserAgentOrigin); 166 document->ensureStyleResolver().viewportStyleResolver()->collectViewport Rules(ruleSet.get(), blink::ViewportStyleResolver::UserAgentOrigin);
167 document->ensureStyleResolver().viewportStyleResolver()->resolve(); 167 document->ensureStyleResolver().viewportStyleResolver()->resolve();
168 } 168 }
169 169
170 static void configueCompositingWebView(WebSettings* settings) 170 static void configueCompositingWebView(WebSettings* settings)
171 { 171 {
(...skipping 6007 matching lines...) Expand 10 before | Expand all | Expand 10 after
6179 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); 6179 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount());
6180 6180
6181 // Neither should a page reload. 6181 // Neither should a page reload.
6182 localFrame->reload(); 6182 localFrame->reload();
6183 EXPECT_EQ(4u, frameClient.provisionalLoadCount()); 6183 EXPECT_EQ(4u, frameClient.provisionalLoadCount());
6184 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition()); 6184 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition());
6185 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); 6185 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount());
6186 } 6186 }
6187 6187
6188 } // namespace 6188 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698