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/browser/web_contents/web_contents_view.h" | 9 #include "content/browser/web_contents/web_contents_view.h" |
10 #include "content/common/frame_messages.h" | 10 #include "content/common/frame_messages.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 // offset -1 on layer_delegate_. | 55 // offset -1 on layer_delegate_. |
56 delete GetOverlay()->CreateBackLayer(); | 56 delete GetOverlay()->CreateBackLayer(); |
57 // Performs BACK navigation, sets image from layer_delegate_ on | 57 // Performs BACK navigation, sets image from layer_delegate_ on |
58 // image_delegate_. | 58 // image_delegate_. |
59 GetOverlay()->OnWindowSlideCompleting(); | 59 GetOverlay()->OnWindowSlideCompleting(); |
60 GetOverlay()->OnWindowSlideCompleted(scoped_ptr<ui::Layer>()); | 60 GetOverlay()->OnWindowSlideCompleted(scoped_ptr<ui::Layer>()); |
61 } | 61 } |
62 | 62 |
63 protected: | 63 protected: |
64 // RenderViewHostImplTestHarness: | 64 // RenderViewHostImplTestHarness: |
65 virtual void SetUp() OVERRIDE { | 65 virtual void SetUp() override { |
66 RenderViewHostImplTestHarness::SetUp(); | 66 RenderViewHostImplTestHarness::SetUp(); |
67 | 67 |
68 const GURL first("https://www.google.com"); | 68 const GURL first("https://www.google.com"); |
69 contents()->NavigateAndCommit(first); | 69 contents()->NavigateAndCommit(first); |
70 EXPECT_TRUE(controller().GetVisibleEntry()); | 70 EXPECT_TRUE(controller().GetVisibleEntry()); |
71 EXPECT_FALSE(controller().CanGoBack()); | 71 EXPECT_FALSE(controller().CanGoBack()); |
72 | 72 |
73 const GURL second("http://www.chromium.org"); | 73 const GURL second("http://www.chromium.org"); |
74 contents()->NavigateAndCommit(second); | 74 contents()->NavigateAndCommit(second); |
75 EXPECT_TRUE(controller().CanGoBack()); | 75 EXPECT_TRUE(controller().CanGoBack()); |
(...skipping 20 matching lines...) Expand all Loading... |
96 root_window())); | 96 root_window())); |
97 | 97 |
98 overlay_->SetOverlayWindow(overlay_window.Pass(), image_delegate); | 98 overlay_->SetOverlayWindow(overlay_window.Pass(), image_delegate); |
99 overlay_->StartObserving(); | 99 overlay_->StartObserving(); |
100 | 100 |
101 EXPECT_TRUE(overlay_->web_contents()); | 101 EXPECT_TRUE(overlay_->web_contents()); |
102 EXPECT_FALSE(overlay_->loading_complete_); | 102 EXPECT_FALSE(overlay_->loading_complete_); |
103 EXPECT_FALSE(overlay_->received_paint_update_); | 103 EXPECT_FALSE(overlay_->received_paint_update_); |
104 } | 104 } |
105 | 105 |
106 virtual void TearDown() OVERRIDE { | 106 virtual void TearDown() override { |
107 overlay_.reset(); | 107 overlay_.reset(); |
108 RenderViewHostImplTestHarness::TearDown(); | 108 RenderViewHostImplTestHarness::TearDown(); |
109 } | 109 } |
110 | 110 |
111 OverscrollNavigationOverlay* GetOverlay() { | 111 OverscrollNavigationOverlay* GetOverlay() { |
112 return overlay_.get(); | 112 return overlay_.get(); |
113 } | 113 } |
114 | 114 |
115 private: | 115 private: |
116 scoped_ptr<OverscrollNavigationOverlay> overlay_; | 116 scoped_ptr<OverscrollNavigationOverlay> overlay_; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 // (which can happen if a new navigation is performed while while a GestureNav | 185 // (which can happen if a new navigation is performed while while a GestureNav |
186 // navigation is in progress). | 186 // navigation is in progress). |
187 contents()->TestSetIsLoading(true); | 187 contents()->TestSetIsLoading(true); |
188 contents()->TestSetIsLoading(false); | 188 contents()->TestSetIsLoading(false); |
189 EXPECT_TRUE(GetOverlay()->loading_complete_); | 189 EXPECT_TRUE(GetOverlay()->loading_complete_); |
190 | 190 |
191 EXPECT_FALSE(GetOverlay()->web_contents()); | 191 EXPECT_FALSE(GetOverlay()->web_contents()); |
192 } | 192 } |
193 | 193 |
194 } // namespace content | 194 } // namespace content |
OLD | NEW |