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

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

Issue 2096633002: Adds scroll position/scale emulation to DevTools. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Emulator using GC, moved to FrameHost, addressed other comments. Created 4 years, 5 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 1058 matching lines...) Expand 10 before | Expand all | Expand 10 after
1069 1069
1070 TEST_F(WebViewTest, ExitingDeviceEmulationResetsPageScale) 1070 TEST_F(WebViewTest, ExitingDeviceEmulationResetsPageScale)
1071 { 1071 {
1072 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("200-by-300.html")); 1072 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), WebString::fromUTF8("200-by-300.html"));
1073 WebViewImpl* webViewImpl = m_webViewHelper.initializeAndLoad(m_baseURL + "20 0-by-300.html"); 1073 WebViewImpl* webViewImpl = m_webViewHelper.initializeAndLoad(m_baseURL + "20 0-by-300.html");
1074 webViewImpl->resize(WebSize(200, 300)); 1074 webViewImpl->resize(WebSize(200, 300));
1075 1075
1076 float pageScaleExpected = webViewImpl->pageScaleFactor(); 1076 float pageScaleExpected = webViewImpl->pageScaleFactor();
1077 1077
1078 WebDeviceEmulationParams params; 1078 WebDeviceEmulationParams params;
1079 params.screenPosition = WebDeviceEmulationParams::Desktop; 1079 params.screenPosition = WebDeviceEmulationParams::Mobile;
bokan 2016/07/06 14:26:31 Why did this have to change?
Eric Seckler 2016/07/11 10:38:44 Reverted.
1080 params.deviceScaleFactor = 0; 1080 params.deviceScaleFactor = 0;
1081 params.fitToView = false; 1081 params.fitToView = false;
1082 params.offset = WebFloatPoint(); 1082 params.offset = WebFloatPoint();
1083 params.scale = 1; 1083 params.scale = 1;
1084 1084
1085 webViewImpl->enableDeviceEmulation(params); 1085 webViewImpl->enableDeviceEmulation(params);
1086 1086
1087 webViewImpl->setPageScaleFactor(2); 1087 webViewImpl->setPageScaleFactor(2);
1088 1088
1089 webViewImpl->disableDeviceEmulation(); 1089 webViewImpl->disableDeviceEmulation();
(...skipping 2042 matching lines...) Expand 10 before | Expand all | Expand 10 after
3132 frame->setAutofillClient(&client); 3132 frame->setAutofillClient(&client);
3133 webView->setInitialFocus(false); 3133 webView->setInitialFocus(false);
3134 3134
3135 EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hel lo").c_str()))); 3135 EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hel lo").c_str())));
3136 EXPECT_EQ(1, client.textChangesFromUserGesture()); 3136 EXPECT_EQ(1, client.textChangesFromUserGesture());
3137 EXPECT_FALSE(UserGestureIndicator::processingUserGesture()); 3137 EXPECT_FALSE(UserGestureIndicator::processingUserGesture());
3138 frame->setAutofillClient(0); 3138 frame->setAutofillClient(0);
3139 } 3139 }
3140 3140
3141 } // namespace blink 3141 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698