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

Unified Diff: third_party/WebKit/Source/web/tests/WebFrameTest.cpp

Issue 2423463002: Simpler viewportAndroid.css setup for WebFrameTests. (Closed)
Patch Set: Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/tests/WebFrameTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
index a056554db30a05b2b45a44569a2491b10d5ebbd6..17ff158f6eab50e624e161e123757612a9520240 100644
--- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
@@ -227,21 +227,11 @@ class WebFrameTest : public ::testing::Test {
void applyViewportStyleOverride(
FrameTestHelpers::WebViewHelper* webViewHelper) {
- StyleSheetContents* styleSheet =
- StyleSheetContents::create(CSSParserContext(UASheetMode, nullptr));
- styleSheet->parseString(loadResourceAsASCIIString("viewportAndroid.css"));
- RuleSet* ruleSet = RuleSet::create();
- ruleSet->addRulesFromSheet(styleSheet, MediaQueryEvaluator("screen"));
-
- Document* document =
- toLocalFrame(webViewHelper->webView()->page()->mainFrame())->document();
- document->ensureStyleResolver()
- .viewportStyleResolver()
- ->collectViewportRules(ruleSet, ViewportStyleResolver::UserAgentOrigin);
- document->ensureStyleResolver().viewportStyleResolver()->resolve();
+ webViewHelper->webView()->settings()->setViewportStyle(
+ WebViewportStyle::Mobile);
}
- static void configueCompositingWebView(WebSettings* settings) {
+ static void configureCompositingWebView(WebSettings* settings) {
settings->setAcceleratedCompositingEnabled(true);
settings->setPreferCompositingToLCDTextEnabled(true);
}
@@ -2912,7 +2902,7 @@ TEST_F(WebFrameTest, updateOverlayScrollbarLayers)
wrapUnique(new FakeCompositingWebViewClient());
FrameTestHelpers::WebViewHelper webViewHelper;
webViewHelper.initialize(true, nullptr, fakeCompositingWebViewClient.get(),
- nullptr, &configueCompositingWebView);
+ nullptr, &configureCompositingWebView);
webViewHelper.resize(WebSize(viewWidth, viewHeight));
FrameTestHelpers::loadFrame(webViewHelper.webView()->mainFrame(),
@@ -7167,7 +7157,7 @@ TEST_F(WebFrameTest, overflowHiddenRewrite) {
wrapUnique(new FakeCompositingWebViewClient());
FrameTestHelpers::WebViewHelper webViewHelper;
webViewHelper.initialize(true, nullptr, fakeCompositingWebViewClient.get(),
- nullptr, &configueCompositingWebView);
+ nullptr, &configureCompositingWebView);
webViewHelper.resize(WebSize(100, 100));
FrameTestHelpers::loadFrame(webViewHelper.webView()->mainFrame(),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698