| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/web_contents/aura/overscroll_navigation_overlay.h" | 5 #include "content/browser/web_contents/aura/overscroll_navigation_overlay.h" |
| 6 | 6 |
| 7 #include "content/browser/frame_host/navigation_entry_impl.h" | 7 #include "content/browser/frame_host/navigation_entry_impl.h" |
| 8 #include "content/browser/web_contents/aura/image_window_delegate.h" | 8 #include "content/browser/web_contents/aura/image_window_delegate.h" |
| 9 #include "content/common/view_messages.h" | 9 #include "content/common/view_messages.h" |
| 10 #include "content/public/browser/web_contents_view.h" | 10 #include "content/public/browser/web_contents_view.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 void ReceivePaintUpdate() { | 44 void ReceivePaintUpdate() { |
| 45 ViewHostMsg_DidFirstVisuallyNonEmptyPaint msg( | 45 ViewHostMsg_DidFirstVisuallyNonEmptyPaint msg( |
| 46 test_rvh()->GetRoutingID(), 0); | 46 test_rvh()->GetRoutingID(), 0); |
| 47 RenderViewHostTester::TestOnMessageReceived(test_rvh(), msg); | 47 RenderViewHostTester::TestOnMessageReceived(test_rvh(), msg); |
| 48 } | 48 } |
| 49 | 49 |
| 50 void PerformBackNavigationViaSliderCallbacks() { | 50 void PerformBackNavigationViaSliderCallbacks() { |
| 51 // Sets slide direction to SLIDE_BACK, sets screenshot from NavEntry at | 51 // Sets slide direction to SLIDE_BACK, sets screenshot from NavEntry at |
| 52 // offset -1 on layer_delegate_. | 52 // offset -1 on layer_delegate_. |
| 53 delete GetOverlay()->CreateBackLayer(); | 53 delete GetOverlay()->OnSlideBackStartedCreateLayer(); |
| 54 // Performs BACK navigation, sets image from layer_delegate_ on | 54 // Performs BACK navigation, sets image from layer_delegate_ on |
| 55 // image_delegate_. | 55 // image_delegate_. |
| 56 GetOverlay()->OnWindowSlideComplete(); | 56 GetOverlay()->OnWindowFlingStarted(); |
| 57 GetOverlay()->OnWindowFlingCompleted(); |
| 57 } | 58 } |
| 58 | 59 |
| 59 protected: | 60 protected: |
| 60 // RenderViewHostImplTestHarness: | 61 // RenderViewHostImplTestHarness: |
| 61 virtual void SetUp() OVERRIDE { | 62 virtual void SetUp() OVERRIDE { |
| 62 RenderViewHostImplTestHarness::SetUp(); | 63 RenderViewHostImplTestHarness::SetUp(); |
| 63 | 64 |
| 64 const GURL first("https://www.google.com"); | 65 const GURL first("https://www.google.com"); |
| 65 contents()->NavigateAndCommit(first); | 66 contents()->NavigateAndCommit(first); |
| 66 EXPECT_TRUE(controller().GetVisibleEntry()); | 67 EXPECT_TRUE(controller().GetVisibleEntry()); |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 // Navigation was committed and the load update was received - the flag | 228 // Navigation was committed and the load update was received - the flag |
| 228 // should now be updated. | 229 // should now be updated. |
| 229 EXPECT_TRUE(GetOverlay()->loading_complete_); | 230 EXPECT_TRUE(GetOverlay()->loading_complete_); |
| 230 | 231 |
| 231 EXPECT_TRUE(GetOverlay()->web_contents()); | 232 EXPECT_TRUE(GetOverlay()->web_contents()); |
| 232 ReceivePaintUpdate(); | 233 ReceivePaintUpdate(); |
| 233 EXPECT_FALSE(GetOverlay()->web_contents()); | 234 EXPECT_FALSE(GetOverlay()->web_contents()); |
| 234 } | 235 } |
| 235 | 236 |
| 236 } // namespace content | 237 } // namespace content |
| OLD | NEW |