Chromium Code Reviews| 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) |