| 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 1168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1179 webViewImpl->mainFrame()->setScrollOffset(WebSize(94, 111)); | 1179 webViewImpl->mainFrame()->setScrollOffset(WebSize(94, 111)); |
| 1180 webViewImpl->setVisualViewportOffset(WebFloatPoint(12, 20)); | 1180 webViewImpl->setVisualViewportOffset(WebFloatPoint(12, 20)); |
| 1181 EXPECT_EQ(2.0f, webViewImpl->pageScaleFactor()); | 1181 EXPECT_EQ(2.0f, webViewImpl->pageScaleFactor()); |
| 1182 EXPECT_EQ(94, webViewImpl->mainFrame()->scrollOffset().width); | 1182 EXPECT_EQ(94, webViewImpl->mainFrame()->scrollOffset().width); |
| 1183 EXPECT_EQ(111, webViewImpl->mainFrame()->scrollOffset().height); | 1183 EXPECT_EQ(111, webViewImpl->mainFrame()->scrollOffset().height); |
| 1184 EXPECT_EQ(12, webViewImpl->visualViewportOffset().x); | 1184 EXPECT_EQ(12, webViewImpl->visualViewportOffset().x); |
| 1185 EXPECT_EQ(20, webViewImpl->visualViewportOffset().y); | 1185 EXPECT_EQ(20, webViewImpl->visualViewportOffset().y); |
| 1186 | 1186 |
| 1187 Element* element = static_cast<Element*>(webViewImpl->mainFrame()->document(
).body()); | 1187 Element* element = static_cast<Element*>(webViewImpl->mainFrame()->document(
).body()); |
| 1188 webViewImpl->enterFullScreenForElement(element); | 1188 webViewImpl->enterFullScreenForElement(element); |
| 1189 webViewImpl->didEnterFullScreen(); | 1189 webViewImpl->didEnterFullscreen(); |
| 1190 | 1190 |
| 1191 // Page scale factor must be 1.0 during fullscreen for elements to be sized | 1191 // Page scale factor must be 1.0 during fullscreen for elements to be sized |
| 1192 // properly. | 1192 // properly. |
| 1193 EXPECT_EQ(1.0f, webViewImpl->pageScaleFactor()); | 1193 EXPECT_EQ(1.0f, webViewImpl->pageScaleFactor()); |
| 1194 | 1194 |
| 1195 // Make sure fullscreen nesting doesn't disrupt scroll/scale saving. | 1195 // Make sure fullscreen nesting doesn't disrupt scroll/scale saving. |
| 1196 Element* otherElement = static_cast<Element*>(webViewImpl->mainFrame()->docu
ment().head()); | 1196 Element* otherElement = static_cast<Element*>(webViewImpl->mainFrame()->docu
ment().head()); |
| 1197 webViewImpl->enterFullScreenForElement(otherElement); | 1197 webViewImpl->enterFullScreenForElement(otherElement); |
| 1198 | 1198 |
| 1199 // Confirm that exiting fullscreen restores the parameters. | 1199 // Confirm that exiting fullscreen restores the parameters. |
| 1200 webViewImpl->didExitFullScreen(); | 1200 webViewImpl->didExitFullscreen(); |
| 1201 EXPECT_EQ(2.0f, webViewImpl->pageScaleFactor()); | 1201 EXPECT_EQ(2.0f, webViewImpl->pageScaleFactor()); |
| 1202 EXPECT_EQ(94, webViewImpl->mainFrame()->scrollOffset().width); | 1202 EXPECT_EQ(94, webViewImpl->mainFrame()->scrollOffset().width); |
| 1203 EXPECT_EQ(111, webViewImpl->mainFrame()->scrollOffset().height); | 1203 EXPECT_EQ(111, webViewImpl->mainFrame()->scrollOffset().height); |
| 1204 EXPECT_EQ(12, webViewImpl->visualViewportOffset().x); | 1204 EXPECT_EQ(12, webViewImpl->visualViewportOffset().x); |
| 1205 EXPECT_EQ(20, webViewImpl->visualViewportOffset().y); | 1205 EXPECT_EQ(20, webViewImpl->visualViewportOffset().y); |
| 1206 | 1206 |
| 1207 m_webViewHelper.reset(); // Explicitly reset to break dependency on locally
scoped client. | 1207 m_webViewHelper.reset(); // Explicitly reset to break dependency on locally
scoped client. |
| 1208 } | 1208 } |
| 1209 | 1209 |
| 1210 class PrintWebViewClient : public FrameTestHelpers::TestWebViewClient { | 1210 class PrintWebViewClient : public FrameTestHelpers::TestWebViewClient { |
| (...skipping 1918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3129 frame->setAutofillClient(&client); | 3129 frame->setAutofillClient(&client); |
| 3130 webView->setInitialFocus(false); | 3130 webView->setInitialFocus(false); |
| 3131 | 3131 |
| 3132 EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hel
lo").c_str()))); | 3132 EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hel
lo").c_str()))); |
| 3133 EXPECT_EQ(1, client.textChangesFromUserGesture()); | 3133 EXPECT_EQ(1, client.textChangesFromUserGesture()); |
| 3134 EXPECT_FALSE(UserGestureIndicator::processingUserGesture()); | 3134 EXPECT_FALSE(UserGestureIndicator::processingUserGesture()); |
| 3135 frame->setAutofillClient(0); | 3135 frame->setAutofillClient(0); |
| 3136 } | 3136 } |
| 3137 | 3137 |
| 3138 } // namespace blink | 3138 } // namespace blink |
| OLD | NEW |