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(); | |
2214 std::string content = WebFrameContentDumper::dumpFrameTreeAsText(webView->ma
inFrame()->toWebLocalFrame(), 21).utf8(); | 2213 std::string content = WebFrameContentDumper::dumpFrameTreeAsText(webView->ma
inFrame()->toWebLocalFrame(), 21).utf8(); |
2215 EXPECT_EQ("regular-ui", content); | 2214 EXPECT_EQ("regular-ui", content); |
2216 | 2215 |
2217 webView->setDisplayMode(WebDisplayModeMinimalUi); | 2216 webView->setDisplayMode(WebDisplayModeMinimalUi); |
2218 webView->updateAllLifecyclePhases(); | |
2219 content = WebFrameContentDumper::dumpFrameTreeAsText(webView->mainFrame()->t
oWebLocalFrame(), 21).utf8(); | 2217 content = WebFrameContentDumper::dumpFrameTreeAsText(webView->mainFrame()->t
oWebLocalFrame(), 21).utf8(); |
2220 EXPECT_EQ("minimal-ui", content); | 2218 EXPECT_EQ("minimal-ui", content); |
2221 m_webViewHelper.reset(); | 2219 m_webViewHelper.reset(); |
2222 } | 2220 } |
2223 | 2221 |
2224 TEST_F(WebViewTest, AddFrameInCloseUnload) | 2222 TEST_F(WebViewTest, AddFrameInCloseUnload) |
2225 { | 2223 { |
2226 CreateChildCounterFrameClient frameClient; | 2224 CreateChildCounterFrameClient frameClient; |
2227 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), WebString::fromUTF8("add_frame_in_unload.html")); | 2225 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), WebString::fromUTF8("add_frame_in_unload.html")); |
2228 m_webViewHelper.initializeAndLoad(m_baseURL + "add_frame_in_unload.html", tr
ue, &frameClient); | 2226 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... |
2680 TEST_F(WebViewTest, CompareSelectAllToContentAsText) | 2678 TEST_F(WebViewTest, CompareSelectAllToContentAsText) |
2681 { | 2679 { |
2682 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), WebString::fromUTF8("longpress_selection.html")); | 2680 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), WebString::fromUTF8("longpress_selection.html")); |
2683 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "longpress_
selection.html", true); | 2681 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "longpress_
selection.html", true); |
2684 | 2682 |
2685 WebLocalFrameImpl* frame = toWebLocalFrameImpl(webView->mainFrame()); | 2683 WebLocalFrameImpl* frame = toWebLocalFrameImpl(webView->mainFrame()); |
2686 frame->executeScript(WebScriptSource(WebString::fromUTF8("document.execComma
nd('SelectAll', false, null)"))); | 2684 frame->executeScript(WebScriptSource(WebString::fromUTF8("document.execComma
nd('SelectAll', false, null)"))); |
2687 std::string actual = frame->selectionAsText().utf8(); | 2685 std::string actual = frame->selectionAsText().utf8(); |
2688 | 2686 |
2689 const int kMaxOutputCharacters = 1024; | 2687 const int kMaxOutputCharacters = 1024; |
2690 webView->updateAllLifecyclePhases(); | |
2691 std::string expected = WebFrameContentDumper::dumpFrameTreeAsText(frame, kMa
xOutputCharacters).utf8(); | 2688 std::string expected = WebFrameContentDumper::dumpFrameTreeAsText(frame, kMa
xOutputCharacters).utf8(); |
2692 EXPECT_EQ(expected, actual); | 2689 EXPECT_EQ(expected, actual); |
2693 } | 2690 } |
2694 | 2691 |
2695 TEST_F(WebViewTest, AutoResizeSubtreeLayout) | 2692 TEST_F(WebViewTest, AutoResizeSubtreeLayout) |
2696 { | 2693 { |
2697 std::string url = m_baseURL + "subtree-layout.html"; | 2694 std::string url = m_baseURL + "subtree-layout.html"; |
2698 URLTestHelpers::registerMockedURLLoad(toKURL(url), "subtree-layout.html"); | 2695 URLTestHelpers::registerMockedURLLoad(toKURL(url), "subtree-layout.html"); |
2699 WebView* webView = m_webViewHelper.initialize(true); | 2696 WebView* webView = m_webViewHelper.initialize(true); |
2700 | 2697 |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3229 frame->setAutofillClient(&client); | 3226 frame->setAutofillClient(&client); |
3230 webView->setInitialFocus(false); | 3227 webView->setInitialFocus(false); |
3231 | 3228 |
3232 EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hel
lo").c_str()))); | 3229 EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hel
lo").c_str()))); |
3233 EXPECT_EQ(1, client.textChangesFromUserGesture()); | 3230 EXPECT_EQ(1, client.textChangesFromUserGesture()); |
3234 EXPECT_FALSE(UserGestureIndicator::processingUserGesture()); | 3231 EXPECT_FALSE(UserGestureIndicator::processingUserGesture()); |
3235 frame->setAutofillClient(0); | 3232 frame->setAutofillClient(0); |
3236 } | 3233 } |
3237 | 3234 |
3238 } // namespace blink | 3235 } // namespace blink |
OLD | NEW |