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

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: 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
« no previous file with comments | « Source/web/WebViewImpl.cpp ('k') | Source/web/tests/data/display_mode.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/tests/WebViewTest.cpp
diff --git a/Source/web/tests/WebViewTest.cpp b/Source/web/tests/WebViewTest.cpp
index 87d2cf54fd1d92d024163b0aa4da4796d29e5b18..93b486e8fbc30ca28a677c25441dc9eec2cca36e 100644
--- a/Source/web/tests/WebViewTest.cpp
+++ b/Source/web/tests/WebViewTest.cpp
@@ -2089,18 +2089,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)
« no previous file with comments | « Source/web/WebViewImpl.cpp ('k') | Source/web/tests/data/display_mode.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698