| 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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 // Tests that an overscroll navigation that receives a loading update actually | 300 // Tests that an overscroll navigation that receives a loading update actually |
| 301 // stops observing. | 301 // stops observing. |
| 302 TEST_F(OverscrollNavigationOverlayTest, Navigation_LoadingUpdate) { | 302 TEST_F(OverscrollNavigationOverlayTest, Navigation_LoadingUpdate) { |
| 303 PerformBackNavigationViaSliderCallbacks(); | 303 PerformBackNavigationViaSliderCallbacks(); |
| 304 EXPECT_TRUE(GetOverlay()->web_contents()); | 304 EXPECT_TRUE(GetOverlay()->web_contents()); |
| 305 // DidStopLoading for any navigation should always reset the load flag and | 305 // DidStopLoading for any navigation should always reset the load flag and |
| 306 // dismiss the overlay even if the pending navigation wasn't committed - | 306 // dismiss the overlay even if the pending navigation wasn't committed - |
| 307 // this is a "safety net" in case we mis-identify the destination webpage | 307 // this is a "safety net" in case we mis-identify the destination webpage |
| 308 // (which can happen if a new navigation is performed while while a GestureNav | 308 // (which can happen if a new navigation is performed while while a GestureNav |
| 309 // navigation is in progress). | 309 // navigation is in progress). |
| 310 contents()->TestSetIsLoading(true); |
| 310 contents()->TestSetIsLoading(false); | 311 contents()->TestSetIsLoading(false); |
| 311 EXPECT_FALSE(GetOverlay()->web_contents()); | 312 EXPECT_FALSE(GetOverlay()->web_contents()); |
| 312 NavigationEntry* pending = contents()->GetController().GetPendingEntry(); | 313 NavigationEntry* pending = contents()->GetController().GetPendingEntry(); |
| 313 contents()->GetPendingMainFrame()->SendNavigate( | 314 contents()->GetPendingMainFrame()->SendNavigate( |
| 314 pending->GetPageID(), pending->GetUniqueID(), false, pending->GetURL()); | 315 pending->GetPageID(), pending->GetUniqueID(), false, pending->GetURL()); |
| 315 EXPECT_EQ(contents()->GetURL(), third()); | 316 EXPECT_EQ(contents()->GetURL(), third()); |
| 316 } | 317 } |
| 317 | 318 |
| 318 TEST_F(OverscrollNavigationOverlayTest, CloseDuringAnimation) { | 319 TEST_F(OverscrollNavigationOverlayTest, CloseDuringAnimation) { |
| 319 ui::ScopedAnimationDurationScaleMode normal_duration_( | 320 ui::ScopedAnimationDurationScaleMode normal_duration_( |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 EXPECT_TRUE(GetOverlay()->window_.get()); | 405 EXPECT_TRUE(GetOverlay()->window_.get()); |
| 405 | 406 |
| 406 // Load the page. | 407 // Load the page. |
| 407 contents()->CommitPendingNavigation(); | 408 contents()->CommitPendingNavigation(); |
| 408 ReceivePaintUpdate(); | 409 ReceivePaintUpdate(); |
| 409 EXPECT_FALSE(GetOverlay()->window_.get()); | 410 EXPECT_FALSE(GetOverlay()->window_.get()); |
| 410 EXPECT_EQ(contents()->GetURL(), first()); | 411 EXPECT_EQ(contents()->GetURL(), first()); |
| 411 } | 412 } |
| 412 | 413 |
| 413 } // namespace content | 414 } // namespace content |
| OLD | NEW |