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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
46 }; | 46 }; |
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_ = |
57 GURL(), main_test_rfh()->frame_tree_node(), base::TimeTicks::Now()); | 57 NavigationHandleImpl::Create(GURL(), main_test_rfh()->frame_tree_node(), |
58 base::TimeTicks::Now(), nullptr); | |
Charlie Reis
2016/02/05 19:36:12
Should we have some tests for the non-null case?
Charlie Harrison
2016/02/05 23:10:23
Not sure. These tests (afaict) don't really do muc
| |
58 } | 59 } |
59 | 60 |
60 void TearDown() override { | 61 void TearDown() override { |
61 // Release the |test_handle_| before destroying the WebContents, to match | 62 // Release the |test_handle_| before destroying the WebContents, to match |
62 // the WebContentsObserverSanityChecker expectations. | 63 // the WebContentsObserverSanityChecker expectations. |
63 test_handle_.reset(); | 64 test_handle_.reset(); |
64 RenderViewHostImplTestHarness::TearDown(); | 65 RenderViewHostImplTestHarness::TearDown(); |
65 } | 66 } |
66 | 67 |
67 bool IsDeferringStart() { | 68 bool IsDeferringStart() { |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
481 EXPECT_FALSE(IsDeferringRedirect()); | 482 EXPECT_FALSE(IsDeferringRedirect()); |
482 EXPECT_TRUE(was_callback_called()); | 483 EXPECT_TRUE(was_callback_called()); |
483 EXPECT_EQ(NavigationThrottle::CANCEL_AND_IGNORE, callback_result()); | 484 EXPECT_EQ(NavigationThrottle::CANCEL_AND_IGNORE, callback_result()); |
484 EXPECT_EQ(0, cancel_throttle->will_start_calls()); | 485 EXPECT_EQ(0, cancel_throttle->will_start_calls()); |
485 EXPECT_EQ(1, cancel_throttle->will_redirect_calls()); | 486 EXPECT_EQ(1, cancel_throttle->will_redirect_calls()); |
486 EXPECT_EQ(0, proceed_throttle->will_start_calls()); | 487 EXPECT_EQ(0, proceed_throttle->will_start_calls()); |
487 EXPECT_EQ(0, proceed_throttle->will_redirect_calls()); | 488 EXPECT_EQ(0, proceed_throttle->will_redirect_calls()); |
488 } | 489 } |
489 | 490 |
490 } // namespace content | 491 } // namespace content |
OLD | NEW |