| 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 <string.h> | 7 #include <string.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 ViewHostMsg_DidFirstVisuallyNonEmptyPaint msg( | 105 ViewHostMsg_DidFirstVisuallyNonEmptyPaint msg( |
| 106 main_test_rfh()->GetRoutingID()); | 106 main_test_rfh()->GetRoutingID()); |
| 107 RenderViewHostTester::TestOnMessageReceived(test_rvh(), msg); | 107 RenderViewHostTester::TestOnMessageReceived(test_rvh(), msg); |
| 108 } | 108 } |
| 109 | 109 |
| 110 void PerformBackNavigationViaSliderCallbacks() { | 110 void PerformBackNavigationViaSliderCallbacks() { |
| 111 // Sets slide direction to BACK, sets screenshot from NavEntry at | 111 // Sets slide direction to BACK, sets screenshot from NavEntry at |
| 112 // offset -1 on layer_delegate_. | 112 // offset -1 on layer_delegate_. |
| 113 scoped_ptr<aura::Window> window( | 113 scoped_ptr<aura::Window> window( |
| 114 GetOverlay()->CreateBackWindow(GetBackSlideWindowBounds())); | 114 GetOverlay()->CreateBackWindow(GetBackSlideWindowBounds())); |
| 115 bool window_created = window; | 115 bool window_created = !!window; |
| 116 // Performs BACK navigation, sets image from layer_delegate_ on | 116 // Performs BACK navigation, sets image from layer_delegate_ on |
| 117 // image_delegate_. | 117 // image_delegate_. |
| 118 GetOverlay()->OnOverscrollCompleting(); | 118 GetOverlay()->OnOverscrollCompleting(); |
| 119 if (window_created) | 119 if (window_created) |
| 120 EXPECT_EQ(GetOverlay()->direction_, OverscrollNavigationOverlay::BACK); | 120 EXPECT_EQ(GetOverlay()->direction_, OverscrollNavigationOverlay::BACK); |
| 121 else | 121 else |
| 122 EXPECT_EQ(GetOverlay()->direction_, OverscrollNavigationOverlay::NONE); | 122 EXPECT_EQ(GetOverlay()->direction_, OverscrollNavigationOverlay::NONE); |
| 123 window->SetBounds(gfx::Rect(root_window()->bounds().size())); | 123 window->SetBounds(gfx::Rect(root_window()->bounds().size())); |
| 124 GetOverlay()->OnOverscrollCompleted(std::move(window)); | 124 GetOverlay()->OnOverscrollCompleted(std::move(window)); |
| 125 if (IsBrowserSideNavigationEnabled()) | 125 if (IsBrowserSideNavigationEnabled()) |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 EXPECT_TRUE(GetOverlay()->window_.get()); | 405 EXPECT_TRUE(GetOverlay()->window_.get()); |
| 406 | 406 |
| 407 // Load the page. | 407 // Load the page. |
| 408 contents()->CommitPendingNavigation(); | 408 contents()->CommitPendingNavigation(); |
| 409 ReceivePaintUpdate(); | 409 ReceivePaintUpdate(); |
| 410 EXPECT_FALSE(GetOverlay()->window_.get()); | 410 EXPECT_FALSE(GetOverlay()->window_.get()); |
| 411 EXPECT_EQ(contents()->GetURL(), first()); | 411 EXPECT_EQ(contents()->GetURL(), first()); |
| 412 } | 412 } |
| 413 | 413 |
| 414 } // namespace content | 414 } // namespace content |
| OLD | NEW |