OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 2192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2203 { | 2203 { |
2204 ++m_count; | 2204 ++m_count; |
2205 return TestWebFrameClient::createChildFrame(parent, scope, name, uniqueName,
sandboxFlags, frameOwnerProperties); | 2205 return TestWebFrameClient::createChildFrame(parent, scope, name, uniqueName,
sandboxFlags, frameOwnerProperties); |
2206 } | 2206 } |
2207 | 2207 |
2208 TEST_F(WebViewTest, ChangeDisplayMode) | 2208 TEST_F(WebViewTest, ChangeDisplayMode) |
2209 { | 2209 { |
2210 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), WebString::fromUTF8("display_mode.html")); | 2210 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), WebString::fromUTF8("display_mode.html")); |
2211 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "display_mo
de.html", true); | 2211 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "display_mo
de.html", true); |
2212 | 2212 |
| 2213 webView->updateAllLifecyclePhases(); |
2213 std::string content = WebFrameContentDumper::dumpFrameTreeAsText(webView->ma
inFrame()->toWebLocalFrame(), 21).utf8(); | 2214 std::string content = WebFrameContentDumper::dumpFrameTreeAsText(webView->ma
inFrame()->toWebLocalFrame(), 21).utf8(); |
2214 EXPECT_EQ("regular-ui", content); | 2215 EXPECT_EQ("regular-ui", content); |
2215 | 2216 |
2216 webView->setDisplayMode(WebDisplayModeMinimalUi); | 2217 webView->setDisplayMode(WebDisplayModeMinimalUi); |
| 2218 webView->updateAllLifecyclePhases(); |
2217 content = WebFrameContentDumper::dumpFrameTreeAsText(webView->mainFrame()->t
oWebLocalFrame(), 21).utf8(); | 2219 content = WebFrameContentDumper::dumpFrameTreeAsText(webView->mainFrame()->t
oWebLocalFrame(), 21).utf8(); |
2218 EXPECT_EQ("minimal-ui", content); | 2220 EXPECT_EQ("minimal-ui", content); |
2219 m_webViewHelper.reset(); | 2221 m_webViewHelper.reset(); |
2220 } | 2222 } |
2221 | 2223 |
2222 TEST_F(WebViewTest, AddFrameInCloseUnload) | 2224 TEST_F(WebViewTest, AddFrameInCloseUnload) |
2223 { | 2225 { |
2224 CreateChildCounterFrameClient frameClient; | 2226 CreateChildCounterFrameClient frameClient; |
2225 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), WebString::fromUTF8("add_frame_in_unload.html")); | 2227 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), WebString::fromUTF8("add_frame_in_unload.html")); |
2226 m_webViewHelper.initializeAndLoad(m_baseURL + "add_frame_in_unload.html", tr
ue, &frameClient); | 2228 m_webViewHelper.initializeAndLoad(m_baseURL + "add_frame_in_unload.html", tr
ue, &frameClient); |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2678 TEST_F(WebViewTest, CompareSelectAllToContentAsText) | 2680 TEST_F(WebViewTest, CompareSelectAllToContentAsText) |
2679 { | 2681 { |
2680 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), WebString::fromUTF8("longpress_selection.html")); | 2682 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), WebString::fromUTF8("longpress_selection.html")); |
2681 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "longpress_
selection.html", true); | 2683 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "longpress_
selection.html", true); |
2682 | 2684 |
2683 WebLocalFrameImpl* frame = toWebLocalFrameImpl(webView->mainFrame()); | 2685 WebLocalFrameImpl* frame = toWebLocalFrameImpl(webView->mainFrame()); |
2684 frame->executeScript(WebScriptSource(WebString::fromUTF8("document.execComma
nd('SelectAll', false, null)"))); | 2686 frame->executeScript(WebScriptSource(WebString::fromUTF8("document.execComma
nd('SelectAll', false, null)"))); |
2685 std::string actual = frame->selectionAsText().utf8(); | 2687 std::string actual = frame->selectionAsText().utf8(); |
2686 | 2688 |
2687 const int kMaxOutputCharacters = 1024; | 2689 const int kMaxOutputCharacters = 1024; |
| 2690 webView->updateAllLifecyclePhases(); |
2688 std::string expected = WebFrameContentDumper::dumpFrameTreeAsText(frame, kMa
xOutputCharacters).utf8(); | 2691 std::string expected = WebFrameContentDumper::dumpFrameTreeAsText(frame, kMa
xOutputCharacters).utf8(); |
2689 EXPECT_EQ(expected, actual); | 2692 EXPECT_EQ(expected, actual); |
2690 } | 2693 } |
2691 | 2694 |
2692 TEST_F(WebViewTest, AutoResizeSubtreeLayout) | 2695 TEST_F(WebViewTest, AutoResizeSubtreeLayout) |
2693 { | 2696 { |
2694 std::string url = m_baseURL + "subtree-layout.html"; | 2697 std::string url = m_baseURL + "subtree-layout.html"; |
2695 URLTestHelpers::registerMockedURLLoad(toKURL(url), "subtree-layout.html"); | 2698 URLTestHelpers::registerMockedURLLoad(toKURL(url), "subtree-layout.html"); |
2696 WebView* webView = m_webViewHelper.initialize(true); | 2699 WebView* webView = m_webViewHelper.initialize(true); |
2697 | 2700 |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3226 frame->setAutofillClient(&client); | 3229 frame->setAutofillClient(&client); |
3227 webView->setInitialFocus(false); | 3230 webView->setInitialFocus(false); |
3228 | 3231 |
3229 EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hel
lo").c_str()))); | 3232 EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hel
lo").c_str()))); |
3230 EXPECT_EQ(1, client.textChangesFromUserGesture()); | 3233 EXPECT_EQ(1, client.textChangesFromUserGesture()); |
3231 EXPECT_FALSE(UserGestureIndicator::processingUserGesture()); | 3234 EXPECT_FALSE(UserGestureIndicator::processingUserGesture()); |
3232 frame->setAutofillClient(0); | 3235 frame->setAutofillClient(0); |
3233 } | 3236 } |
3234 | 3237 |
3235 } // namespace blink | 3238 } // namespace blink |
OLD | NEW |