| 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 1256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1267 webViewImpl->mainFrame()->setScrollOffset(WebSize(0, 900)); | 1267 webViewImpl->mainFrame()->setScrollOffset(WebSize(0, 900)); |
| 1268 LocalFrame* mainFrameLocal = toLocalFrame(webViewImpl->page()->mainFrame()); | 1268 LocalFrame* mainFrameLocal = toLocalFrame(webViewImpl->page()->mainFrame()); |
| 1269 Persistent<HistoryItem> item1 = mainFrameLocal->loader().currentItem(); | 1269 Persistent<HistoryItem> item1 = mainFrameLocal->loader().currentItem(); |
| 1270 | 1270 |
| 1271 // Click an anchor | 1271 // Click an anchor |
| 1272 mainFrameLocal->loader().load(FrameLoadRequest(mainFrameLocal->document(), R
esourceRequest(mainFrameLocal->document()->completeURL("#a")))); | 1272 mainFrameLocal->loader().load(FrameLoadRequest(mainFrameLocal->document(), R
esourceRequest(mainFrameLocal->document()->completeURL("#a")))); |
| 1273 Persistent<HistoryItem> item2 = mainFrameLocal->loader().currentItem(); | 1273 Persistent<HistoryItem> item2 = mainFrameLocal->loader().currentItem(); |
| 1274 | 1274 |
| 1275 // Go back, then forward, then back again. | 1275 // Go back, then forward, then back again. |
| 1276 mainFrameLocal->loader().load( | 1276 mainFrameLocal->loader().load( |
| 1277 FrameLoadRequest(nullptr, FrameLoader::resourceRequestFromHistoryItem( | 1277 FrameLoadRequest(nullptr, FrameLoader::resourceRequestFromHistoryItem(it
em1.get(), WebCachePolicy::UseProtocolCachePolicy)), |
| 1278 item1.get(), UseProtocolCachePolicy)), | |
| 1279 FrameLoadTypeBackForward, item1.get(), HistorySameDocumentLoad); | 1278 FrameLoadTypeBackForward, item1.get(), HistorySameDocumentLoad); |
| 1280 mainFrameLocal->loader().load( | 1279 mainFrameLocal->loader().load( |
| 1281 FrameLoadRequest(nullptr, FrameLoader::resourceRequestFromHistoryItem( | 1280 FrameLoadRequest(nullptr, FrameLoader::resourceRequestFromHistoryItem(it
em2.get(), WebCachePolicy::UseProtocolCachePolicy)), |
| 1282 item2.get(), UseProtocolCachePolicy)), | |
| 1283 FrameLoadTypeBackForward, item2.get(), HistorySameDocumentLoad); | 1281 FrameLoadTypeBackForward, item2.get(), HistorySameDocumentLoad); |
| 1284 mainFrameLocal->loader().load( | 1282 mainFrameLocal->loader().load( |
| 1285 FrameLoadRequest(nullptr, FrameLoader::resourceRequestFromHistoryItem( | 1283 FrameLoadRequest(nullptr, FrameLoader::resourceRequestFromHistoryItem(it
em1.get(), WebCachePolicy::UseProtocolCachePolicy)), |
| 1286 item1.get(), UseProtocolCachePolicy)), | |
| 1287 FrameLoadTypeBackForward, item1.get(), HistorySameDocumentLoad); | 1284 FrameLoadTypeBackForward, item1.get(), HistorySameDocumentLoad); |
| 1288 | 1285 |
| 1289 // Click a different anchor | 1286 // Click a different anchor |
| 1290 mainFrameLocal->loader().load(FrameLoadRequest(mainFrameLocal->document(), R
esourceRequest(mainFrameLocal->document()->completeURL("#b")))); | 1287 mainFrameLocal->loader().load(FrameLoadRequest(mainFrameLocal->document(), R
esourceRequest(mainFrameLocal->document()->completeURL("#b")))); |
| 1291 Persistent<HistoryItem> item3 = mainFrameLocal->loader().currentItem(); | 1288 Persistent<HistoryItem> item3 = mainFrameLocal->loader().currentItem(); |
| 1292 | 1289 |
| 1293 // Go back, then forward. The scroll position should be properly set on the
forward navigation. | 1290 // Go back, then forward. The scroll position should be properly set on the
forward navigation. |
| 1294 mainFrameLocal->loader().load( | 1291 mainFrameLocal->loader().load( |
| 1295 FrameLoadRequest(nullptr, FrameLoader::resourceRequestFromHistoryItem( | 1292 FrameLoadRequest(nullptr, FrameLoader::resourceRequestFromHistoryItem(it
em1.get(), WebCachePolicy::UseProtocolCachePolicy)), |
| 1296 item1.get(), UseProtocolCachePolicy)), | |
| 1297 FrameLoadTypeBackForward, item1.get(), HistorySameDocumentLoad); | 1293 FrameLoadTypeBackForward, item1.get(), HistorySameDocumentLoad); |
| 1298 mainFrameLocal->loader().load( | 1294 mainFrameLocal->loader().load( |
| 1299 FrameLoadRequest(nullptr, FrameLoader::resourceRequestFromHistoryItem( | 1295 FrameLoadRequest(nullptr, FrameLoader::resourceRequestFromHistoryItem(it
em3.get(), WebCachePolicy::UseProtocolCachePolicy)), |
| 1300 item3.get(), UseProtocolCachePolicy)), | |
| 1301 FrameLoadTypeBackForward, item3.get(), HistorySameDocumentLoad); | 1296 FrameLoadTypeBackForward, item3.get(), HistorySameDocumentLoad); |
| 1302 EXPECT_EQ(0, webViewImpl->mainFrame()->scrollOffset().width); | 1297 EXPECT_EQ(0, webViewImpl->mainFrame()->scrollOffset().width); |
| 1303 EXPECT_GT(webViewImpl->mainFrame()->scrollOffset().height, 2000); | 1298 EXPECT_GT(webViewImpl->mainFrame()->scrollOffset().height, 2000); |
| 1304 } | 1299 } |
| 1305 | 1300 |
| 1306 TEST_F(WebViewTest, EnterFullscreenResetScrollAndScaleState) | 1301 TEST_F(WebViewTest, EnterFullscreenResetScrollAndScaleState) |
| 1307 { | 1302 { |
| 1308 FrameTestHelpers::TestWebViewClient client; | 1303 FrameTestHelpers::TestWebViewClient client; |
| 1309 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), WebString::fromUTF8("200-by-300.html")); | 1304 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), WebString::fromUTF8("200-by-300.html")); |
| 1310 WebViewImpl* webViewImpl = m_webViewHelper.initializeAndLoad(m_baseURL + "20
0-by-300.html", true, 0, &client); | 1305 WebViewImpl* webViewImpl = m_webViewHelper.initializeAndLoad(m_baseURL + "20
0-by-300.html", true, 0, &client); |
| (...skipping 1964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3275 frame->setAutofillClient(&client); | 3270 frame->setAutofillClient(&client); |
| 3276 webView->setInitialFocus(false); | 3271 webView->setInitialFocus(false); |
| 3277 | 3272 |
| 3278 EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hel
lo").c_str()))); | 3273 EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hel
lo").c_str()))); |
| 3279 EXPECT_EQ(1, client.textChangesFromUserGesture()); | 3274 EXPECT_EQ(1, client.textChangesFromUserGesture()); |
| 3280 EXPECT_FALSE(UserGestureIndicator::processingUserGesture()); | 3275 EXPECT_FALSE(UserGestureIndicator::processingUserGesture()); |
| 3281 frame->setAutofillClient(0); | 3276 frame->setAutofillClient(0); |
| 3282 } | 3277 } |
| 3283 | 3278 |
| 3284 } // namespace blink | 3279 } // namespace blink |
| OLD | NEW |