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

Unified Diff: Source/web/tests/WebViewTest.cpp

Issue 1285703004: Update css styles after modifying display mode (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: updated patch Created 5 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 side-by-side diff with in-line comments
Download patch
Index: Source/web/tests/WebViewTest.cpp
diff --git a/Source/web/tests/WebViewTest.cpp b/Source/web/tests/WebViewTest.cpp
index 3c654c3750e2d071e855d8f66815e65620e0848d..ac0c6c1cf8a0015665f1db5aa7a9f5618343a579 100644
--- a/Source/web/tests/WebViewTest.cpp
+++ b/Source/web/tests/WebViewTest.cpp
@@ -2106,18 +2106,16 @@ WebFrame* CreateChildCounterFrameClient::createChildFrame(WebLocalFrame* parent,
TEST_F(WebViewTest, ChangeDisplayMode)
{
- WebView* webView = m_webViewHelper.initializeAndLoad("about:blank", true);
+ URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c_str()), WebString::fromUTF8("display_mode.html"));
+ WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "display_mode.html", true);
- WebScriptSource source("document.querySelector('body').innerHTML = window.matchMedia('(display-mode: minimal-ui)').matches");
-
- webView->mainFrame()->executeScript(source);
- std::string content = webView->mainFrame()->contentAsText(5).utf8();
- EXPECT_EQ("false", content);
+ std::string content = webView->mainFrame()->contentAsText(21).utf8();
+ EXPECT_EQ("regular-ui", content);
webView->setDisplayMode(WebDisplayModeMinimalUi);
- webView->mainFrame()->executeScript(source);
- content = webView->mainFrame()->contentAsText(5).utf8();
- EXPECT_EQ("true", content);
+ content = webView->mainFrame()->contentAsText(21).utf8();
+ EXPECT_EQ("minimal-ui", content);
+ m_webViewHelper.reset();
}
TEST_F(WebViewTest, AddFrameInCloseUnload)

Powered by Google App Engine
This is Rietveld 408576698