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

Side by Side Diff: third_party/WebKit/Source/web/tests/WebViewTest.cpp

Issue 1397713004: Don't bother layout until first navigation is done. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another attempt to fix tests Created 4 years, 9 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 unified diff | Download patch
OLDNEW
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 2196 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 std::string content = WebFrameContentDumper::dumpFrameTreeAsText(webView->ma inFrame()->toWebLocalFrame(), 21).utf8(); 2213 std::string content = WebFrameContentDumper::dumpFrameTreeAsText(webView->ma inFrame()->toWebLocalFrame(), 21).utf8();
2214 EXPECT_EQ("regular-ui", content); 2214 EXPECT_EQ("regular-ui", content);
2215 2215
2216 webView->setDisplayMode(WebDisplayModeMinimalUi); 2216 webView->setDisplayMode(WebDisplayModeMinimalUi);
2217
2218 // Required to see any updates in dumpFrameTreeAsText.
2219 m_webViewHelper.webView()->updateAllLifecyclePhases();
2220
2217 content = WebFrameContentDumper::dumpFrameTreeAsText(webView->mainFrame()->t oWebLocalFrame(), 21).utf8(); 2221 content = WebFrameContentDumper::dumpFrameTreeAsText(webView->mainFrame()->t oWebLocalFrame(), 21).utf8();
2218 EXPECT_EQ("minimal-ui", content); 2222 EXPECT_EQ("minimal-ui", content);
2219 m_webViewHelper.reset(); 2223 m_webViewHelper.reset();
2220 } 2224 }
2221 2225
2222 TEST_F(WebViewTest, AddFrameInCloseUnload) 2226 TEST_F(WebViewTest, AddFrameInCloseUnload)
2223 { 2227 {
2224 CreateChildCounterFrameClient frameClient; 2228 CreateChildCounterFrameClient frameClient;
2225 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("add_frame_in_unload.html")); 2229 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); 2230 m_webViewHelper.initializeAndLoad(m_baseURL + "add_frame_in_unload.html", tr ue, &frameClient);
(...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after
3226 frame->setAutofillClient(&client); 3230 frame->setAutofillClient(&client);
3227 webView->setInitialFocus(false); 3231 webView->setInitialFocus(false);
3228 3232
3229 EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hel lo").c_str()))); 3233 EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hel lo").c_str())));
3230 EXPECT_EQ(1, client.textChangesFromUserGesture()); 3234 EXPECT_EQ(1, client.textChangesFromUserGesture());
3231 EXPECT_FALSE(UserGestureIndicator::processingUserGesture()); 3235 EXPECT_FALSE(UserGestureIndicator::processingUserGesture());
3232 frame->setAutofillClient(0); 3236 frame->setAutofillClient(0);
3233 } 3237 }
3234 3238
3235 } // namespace blink 3239 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/tests/WebFrameTest.cpp ('k') | third_party/WebKit/Source/web/tests/sim/SimTest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698