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

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
« Source/core/frame/FrameView.cpp ('K') | « Source/core/frame/FrameView.cpp ('k') | no next file » | 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 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"));
kenneth.r.christiansen 2015/08/17 09:03:36 You forgot to add this display_mode.html file?
a.renevier 2015/08/17 17:25:57 Done.
+ 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();
Mike West 2015/08/17 15:29:06 21?
a.renevier 2015/08/17 17:25:57 size of "regular-ui" + "minimal-ui" + 1
+ EXPECT_EQ("regular-ui", content);
kenneth.r.christiansen 2015/08/17 09:03:36 regular-ui? That is not a valid value for display-
a.renevier 2015/08/17 17:25:57 In my test file, I only check if display mode is m
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)
« Source/core/frame/FrameView.cpp ('K') | « Source/core/frame/FrameView.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698