| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "base/macros.h" | 5 #include "base/macros.h" |
| 6 #include "content/browser/frame_host/navigation_handle_impl.h" | 6 #include "content/browser/frame_host/navigation_handle_impl.h" |
| 7 #include "content/public/browser/navigation_throttle.h" | 7 #include "content/public/browser/navigation_throttle.h" |
| 8 #include "content/test/test_render_frame_host.h" | 8 #include "content/test/test_render_frame_host.h" |
| 9 | 9 |
| 10 namespace content { | 10 namespace content { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 class NavigationHandleImplTest : public RenderViewHostImplTestHarness { | 48 class NavigationHandleImplTest : public RenderViewHostImplTestHarness { |
| 49 public: | 49 public: |
| 50 NavigationHandleImplTest() | 50 NavigationHandleImplTest() |
| 51 : was_callback_called_(false), | 51 : was_callback_called_(false), |
| 52 callback_result_(NavigationThrottle::DEFER) {} | 52 callback_result_(NavigationThrottle::DEFER) {} |
| 53 | 53 |
| 54 void SetUp() override { | 54 void SetUp() override { |
| 55 RenderViewHostImplTestHarness::SetUp(); | 55 RenderViewHostImplTestHarness::SetUp(); |
| 56 test_handle_ = NavigationHandleImpl::Create( | 56 test_handle_ = NavigationHandleImpl::Create( |
| 57 GURL(), main_test_rfh()->frame_tree_node()); | 57 GURL(), main_test_rfh()->frame_tree_node(), base::TimeTicks::Now()); |
| 58 } | 58 } |
| 59 | 59 |
| 60 void TearDown() override { | 60 void TearDown() override { |
| 61 // Release the |test_handle_| before destroying the WebContents, to match | 61 // Release the |test_handle_| before destroying the WebContents, to match |
| 62 // the WebContentsObserverSanityChecker expectations. | 62 // the WebContentsObserverSanityChecker expectations. |
| 63 test_handle_.reset(); | 63 test_handle_.reset(); |
| 64 RenderViewHostImplTestHarness::TearDown(); | 64 RenderViewHostImplTestHarness::TearDown(); |
| 65 } | 65 } |
| 66 | 66 |
| 67 bool IsDeferringStart() { | 67 bool IsDeferringStart() { |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 EXPECT_FALSE(IsDeferringRedirect()); | 381 EXPECT_FALSE(IsDeferringRedirect()); |
| 382 EXPECT_TRUE(was_callback_called()); | 382 EXPECT_TRUE(was_callback_called()); |
| 383 EXPECT_EQ(NavigationThrottle::CANCEL_AND_IGNORE, callback_result()); | 383 EXPECT_EQ(NavigationThrottle::CANCEL_AND_IGNORE, callback_result()); |
| 384 EXPECT_EQ(0, cancel_throttle->will_start_calls()); | 384 EXPECT_EQ(0, cancel_throttle->will_start_calls()); |
| 385 EXPECT_EQ(1, cancel_throttle->will_redirect_calls()); | 385 EXPECT_EQ(1, cancel_throttle->will_redirect_calls()); |
| 386 EXPECT_EQ(0, proceed_throttle->will_start_calls()); | 386 EXPECT_EQ(0, proceed_throttle->will_start_calls()); |
| 387 EXPECT_EQ(0, proceed_throttle->will_redirect_calls()); | 387 EXPECT_EQ(0, proceed_throttle->will_redirect_calls()); |
| 388 } | 388 } |
| 389 | 389 |
| 390 } // namespace content | 390 } // namespace content |
| OLD | NEW |