| 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); | |
| 311 contents()->TestSetIsLoading(false); | 310 contents()->TestSetIsLoading(false); |
| 312 EXPECT_FALSE(GetOverlay()->web_contents()); | 311 EXPECT_FALSE(GetOverlay()->web_contents()); |
| 313 NavigationEntry* pending = contents()->GetController().GetPendingEntry(); | 312 NavigationEntry* pending = contents()->GetController().GetPendingEntry(); |
| 314 contents()->GetPendingMainFrame()->SendNavigate( | 313 contents()->GetPendingMainFrame()->SendNavigate( |
| 315 pending->GetPageID(), pending->GetUniqueID(), false, pending->GetURL()); | 314 pending->GetPageID(), pending->GetUniqueID(), false, pending->GetURL()); |
| 316 EXPECT_EQ(contents()->GetURL(), third()); | 315 EXPECT_EQ(contents()->GetURL(), third()); |
| 317 } | 316 } |
| 318 | 317 |
| 319 TEST_F(OverscrollNavigationOverlayTest, CloseDuringAnimation) { | 318 TEST_F(OverscrollNavigationOverlayTest, CloseDuringAnimation) { |
| 320 ui::ScopedAnimationDurationScaleMode normal_duration_( | 319 ui::ScopedAnimationDurationScaleMode normal_duration_( |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 EXPECT_TRUE(GetOverlay()->window_.get()); | 404 EXPECT_TRUE(GetOverlay()->window_.get()); |
| 406 | 405 |
| 407 // Load the page. | 406 // Load the page. |
| 408 contents()->CommitPendingNavigation(); | 407 contents()->CommitPendingNavigation(); |
| 409 ReceivePaintUpdate(); | 408 ReceivePaintUpdate(); |
| 410 EXPECT_FALSE(GetOverlay()->window_.get()); | 409 EXPECT_FALSE(GetOverlay()->window_.get()); |
| 411 EXPECT_EQ(contents()->GetURL(), first()); | 410 EXPECT_EQ(contents()->GetURL(), first()); |
| 412 } | 411 } |
| 413 | 412 |
| 414 } // namespace content | 413 } // namespace content |
| OLD | NEW |