| 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 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 891 // Emulate a user scroll | 891 // Emulate a user scroll |
| 892 webViewImpl->setMainFrameScrollOffset(WebPoint(0, 900)); | 892 webViewImpl->setMainFrameScrollOffset(WebPoint(0, 900)); |
| 893 LocalFrame* mainFrameLocal = toLocalFrame(webViewImpl->page()->mainFrame()); | 893 LocalFrame* mainFrameLocal = toLocalFrame(webViewImpl->page()->mainFrame()); |
| 894 RefPtr<HistoryItem> item1 = mainFrameLocal->loader().currentItem(); | 894 RefPtr<HistoryItem> item1 = mainFrameLocal->loader().currentItem(); |
| 895 | 895 |
| 896 // Click an anchor | 896 // Click an anchor |
| 897 mainFrameLocal->loader().load(FrameLoadRequest(mainFrameLocal->document(), R
esourceRequest(mainFrameLocal->document()->completeURL("#a")))); | 897 mainFrameLocal->loader().load(FrameLoadRequest(mainFrameLocal->document(), R
esourceRequest(mainFrameLocal->document()->completeURL("#a")))); |
| 898 RefPtr<HistoryItem> item2 = mainFrameLocal->loader().currentItem(); | 898 RefPtr<HistoryItem> item2 = mainFrameLocal->loader().currentItem(); |
| 899 | 899 |
| 900 // Go back, then forward, then back again. | 900 // Go back, then forward, then back again. |
| 901 mainFrameLocal->loader().loadHistoryItem(item1.get(), HistorySameDocumentLoa
d); | 901 mainFrameLocal->loader().loadHistoryItem(item1.get(), FrameLoadTypeBackForwa
rd, HistorySameDocumentLoad); |
| 902 mainFrameLocal->loader().loadHistoryItem(item2.get(), HistorySameDocumentLoa
d); | 902 mainFrameLocal->loader().loadHistoryItem(item2.get(), FrameLoadTypeBackForwa
rd, HistorySameDocumentLoad); |
| 903 mainFrameLocal->loader().loadHistoryItem(item1.get(), HistorySameDocumentLoa
d); | 903 mainFrameLocal->loader().loadHistoryItem(item1.get(), FrameLoadTypeBackForwa
rd, HistorySameDocumentLoad); |
| 904 | 904 |
| 905 // Click a different anchor | 905 // Click a different anchor |
| 906 mainFrameLocal->loader().load(FrameLoadRequest(mainFrameLocal->document(), R
esourceRequest(mainFrameLocal->document()->completeURL("#b")))); | 906 mainFrameLocal->loader().load(FrameLoadRequest(mainFrameLocal->document(), R
esourceRequest(mainFrameLocal->document()->completeURL("#b")))); |
| 907 RefPtr<HistoryItem> item3 = mainFrameLocal->loader().currentItem(); | 907 RefPtr<HistoryItem> item3 = mainFrameLocal->loader().currentItem(); |
| 908 | 908 |
| 909 // Go back, then forward. The scroll position should be properly set on the
forward navigation. | 909 // Go back, then forward. The scroll position should be properly set on the
forward navigation. |
| 910 mainFrameLocal->loader().loadHistoryItem(item1.get(), HistorySameDocumentLoa
d); | 910 mainFrameLocal->loader().loadHistoryItem(item1.get(), FrameLoadTypeBackForwa
rd, HistorySameDocumentLoad); |
| 911 mainFrameLocal->loader().loadHistoryItem(item3.get(), HistorySameDocumentLoa
d); | 911 mainFrameLocal->loader().loadHistoryItem(item3.get(), FrameLoadTypeBackForwa
rd, HistorySameDocumentLoad); |
| 912 EXPECT_EQ(0, webViewImpl->mainFrame()->scrollOffset().width); | 912 EXPECT_EQ(0, webViewImpl->mainFrame()->scrollOffset().width); |
| 913 EXPECT_GT(webViewImpl->mainFrame()->scrollOffset().height, 2000); | 913 EXPECT_GT(webViewImpl->mainFrame()->scrollOffset().height, 2000); |
| 914 } | 914 } |
| 915 | 915 |
| 916 class EnterFullscreenWebViewClient : public FrameTestHelpers::TestWebViewClient
{ | 916 class EnterFullscreenWebViewClient : public FrameTestHelpers::TestWebViewClient
{ |
| 917 public: | 917 public: |
| 918 // WebViewClient methods | 918 // WebViewClient methods |
| 919 virtual bool enterFullScreen() { return true; } | 919 virtual bool enterFullScreen() { return true; } |
| 920 virtual void exitFullScreen() { } | 920 virtual void exitFullScreen() { } |
| 921 }; | 921 }; |
| (...skipping 1294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2216 loadFrame(webView->mainFrame(), url); | 2216 loadFrame(webView->mainFrame(), url); |
| 2217 | 2217 |
| 2218 FrameView* frameView = m_webViewHelper.webViewImpl()->mainFrameImpl()->frame
View(); | 2218 FrameView* frameView = m_webViewHelper.webViewImpl()->mainFrameImpl()->frame
View(); |
| 2219 | 2219 |
| 2220 // Auto-resizing used to ASSERT(needsLayout()) in RenderBlockFlow::layout. T
his EXPECT is | 2220 // Auto-resizing used to ASSERT(needsLayout()) in RenderBlockFlow::layout. T
his EXPECT is |
| 2221 // merely a dummy. The real test is that we don't trigger asserts in debug b
uilds. | 2221 // merely a dummy. The real test is that we don't trigger asserts in debug b
uilds. |
| 2222 EXPECT_FALSE(frameView->needsLayout()); | 2222 EXPECT_FALSE(frameView->needsLayout()); |
| 2223 }; | 2223 }; |
| 2224 | 2224 |
| 2225 } // namespace | 2225 } // namespace |
| OLD | NEW |