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

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: Created 6 years, 4 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/FullscreenElementStack.h" 42 #include "core/dom/FullscreenElementStack.h"
44 #include "core/dom/Range.h" 43 #include "core/dom/Range.h"
45 #include "core/editing/Editor.h" 44 #include "core/editing/Editor.h"
46 #include "core/editing/FrameSelection.h" 45 #include "core/editing/FrameSelection.h"
47 #include "core/editing/SpellChecker.h" 46 #include "core/editing/SpellChecker.h"
(...skipping 14 matching lines...) Expand all
62 #include "core/rendering/RenderView.h" 61 #include "core/rendering/RenderView.h"
63 #include "core/rendering/compositing/RenderLayerCompositor.h" 62 #include "core/rendering/compositing/RenderLayerCompositor.h"
64 #include "platform/DragImage.h" 63 #include "platform/DragImage.h"
65 #include "platform/RuntimeEnabledFeatures.h" 64 #include "platform/RuntimeEnabledFeatures.h"
66 #include "platform/UserGestureIndicator.h" 65 #include "platform/UserGestureIndicator.h"
67 #include "platform/geometry/FloatRect.h" 66 #include "platform/geometry/FloatRect.h"
68 #include "platform/network/ResourceError.h" 67 #include "platform/network/ResourceError.h"
69 #include "platform/scroll/ScrollbarTheme.h" 68 #include "platform/scroll/ScrollbarTheme.h"
70 #include "platform/weborigin/SchemeRegistry.h" 69 #include "platform/weborigin/SchemeRegistry.h"
71 #include "public/platform/Platform.h" 70 #include "public/platform/Platform.h"
71 #include "public/platform/WebData.h"
72 #include "public/platform/WebFloatRect.h" 72 #include "public/platform/WebFloatRect.h"
73 #include "public/platform/WebSelectionBound.h" 73 #include "public/platform/WebSelectionBound.h"
74 #include "public/platform/WebThread.h" 74 #include "public/platform/WebThread.h"
75 #include "public/platform/WebURL.h" 75 #include "public/platform/WebURL.h"
76 #include "public/platform/WebURLResponse.h" 76 #include "public/platform/WebURLResponse.h"
77 #include "public/platform/WebUnitTestSupport.h" 77 #include "public/platform/WebUnitTestSupport.h"
78 #include "public/web/WebDataSource.h" 78 #include "public/web/WebDataSource.h"
79 #include "public/web/WebDocument.h" 79 #include "public/web/WebDocument.h"
80 #include "public/web/WebFindOptions.h" 80 #include "public/web/WebFindOptions.h"
81 #include "public/web/WebFormElement.h" 81 #include "public/web/WebFormElement.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 } 147 }
148 148
149 void registerMockedChromeURLLoad(const std::string& fileName) 149 void registerMockedChromeURLLoad(const std::string& fileName)
150 { 150 {
151 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_chrom eURL.c_str()), WebString::fromUTF8(fileName.c_str())); 151 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_chrom eURL.c_str()), WebString::fromUTF8(fileName.c_str()));
152 } 152 }
153 153
154 void applyViewportStyleOverride(FrameTestHelpers::WebViewHelper* webViewHelp er) 154 void applyViewportStyleOverride(FrameTestHelpers::WebViewHelper* webViewHelp er)
155 { 155 {
156 RefPtrWillBeRawPtr<blink::StyleSheetContents> styleSheet = blink::StyleS heetContents::create(blink::CSSParserContext(blink::UASheetMode, 0)); 156 RefPtrWillBeRawPtr<blink::StyleSheetContents> styleSheet = blink::StyleS heetContents::create(blink::CSSParserContext(blink::UASheetMode, 0));
157 styleSheet->parseString(String(blink::viewportAndroidCss, sizeof(blink:: viewportAndroidCss))); 157 const blink::WebData& viewportAndroidCssResource = blink::Platform::curr ent()->loadResource("viewportAndroid.css");
158 String viewportAndroidRules = viewportAndroidCssResource.toASCIIString() ;
159 ASSERT(!viewportAndroidRules.isEmpty());
160 styleSheet->parseString(viewportAndroidRules);
158 OwnPtrWillBeRawPtr<blink::RuleSet> ruleSet = blink::RuleSet::create(); 161 OwnPtrWillBeRawPtr<blink::RuleSet> ruleSet = blink::RuleSet::create();
159 ruleSet->addRulesFromSheet(styleSheet.get(), blink::MediaQueryEvaluator( "screen")); 162 ruleSet->addRulesFromSheet(styleSheet.get(), blink::MediaQueryEvaluator( "screen"));
160 163
161 Document* document = toLocalFrame(webViewHelper->webViewImpl()->page()-> mainFrame())->document(); 164 Document* document = toLocalFrame(webViewHelper->webViewImpl()->page()-> mainFrame())->document();
162 document->ensureStyleResolver().viewportStyleResolver()->collectViewport Rules(ruleSet.get(), blink::ViewportStyleResolver::UserAgentOrigin); 165 document->ensureStyleResolver().viewportStyleResolver()->collectViewport Rules(ruleSet.get(), blink::ViewportStyleResolver::UserAgentOrigin);
163 document->ensureStyleResolver().viewportStyleResolver()->resolve(); 166 document->ensureStyleResolver().viewportStyleResolver()->resolve();
164 } 167 }
165 168
166 static void configueCompositingWebView(WebSettings* settings) 169 static void configueCompositingWebView(WebSettings* settings)
167 { 170 {
(...skipping 5753 matching lines...) Expand 10 before | Expand all | Expand 10 after
5921 5924
5922 client.reset(); 5925 client.reset();
5923 // Try to load the request with cross origin access. Should succeed. 5926 // Try to load the request with cross origin access. Should succeed.
5924 options.crossOriginRequestPolicy = blink::AllowCrossOriginRequests; 5927 options.crossOriginRequestPolicy = blink::AllowCrossOriginRequests;
5925 blink::DocumentThreadableLoader::loadResourceSynchronously( 5928 blink::DocumentThreadableLoader::loadResourceSynchronously(
5926 *frame->document(), blink::ResourceRequest(resourceUrl), client, options , resourceLoaderOptions); 5929 *frame->document(), blink::ResourceRequest(resourceUrl), client, options , resourceLoaderOptions);
5927 EXPECT_FALSE(client.failed()); 5930 EXPECT_FALSE(client.failed());
5928 } 5931 }
5929 5932
5930 } // namespace 5933 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698