| 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 <memory> | 5 #include <memory> |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "services/navigation/public/interfaces/view.mojom.h" | 9 #include "services/navigation/public/interfaces/view.mojom.h" |
| 10 #include "services/service_manager/public/cpp/service.h" | 10 #include "services/service_manager/public/cpp/service.h" |
| 11 #include "services/service_manager/public/cpp/service_test.h" | 11 #include "services/service_manager/public/cpp/service_test.h" |
| 12 | 12 |
| 13 namespace navigation { | 13 namespace navigation { |
| 14 | 14 |
| 15 class NavigationTest : public shell::test::ServiceTest, | 15 class NavigationTest : public service_manager::test::ServiceTest, |
| 16 public mojom::ViewClient { | 16 public mojom::ViewClient { |
| 17 public: | 17 public: |
| 18 NavigationTest() | 18 NavigationTest() |
| 19 : shell::test::ServiceTest("exe:navigation_unittests"), | 19 : service_manager::test::ServiceTest("exe:navigation_unittests"), |
| 20 binding_(this) {} | 20 binding_(this) {} |
| 21 ~NavigationTest() override {} | 21 ~NavigationTest() override {} |
| 22 | 22 |
| 23 protected: | 23 protected: |
| 24 void SetUp() override { | 24 void SetUp() override { |
| 25 shell::test::ServiceTest::SetUp(); | 25 service_manager::test::ServiceTest::SetUp(); |
| 26 window_manager_connection_ = connector()->Connect("service:test_wm"); | 26 window_manager_connection_ = connector()->Connect("service:test_wm"); |
| 27 } | 27 } |
| 28 | 28 |
| 29 mojom::ViewClientPtr GetViewClient() { | 29 mojom::ViewClientPtr GetViewClient() { |
| 30 return binding_.CreateInterfacePtrAndBind(); | 30 return binding_.CreateInterfacePtrAndBind(); |
| 31 } | 31 } |
| 32 | 32 |
| 33 void QuitOnLoadingStateChange(base::RunLoop* loop) { | 33 void QuitOnLoadingStateChange(base::RunLoop* loop) { |
| 34 loop_ = loop; | 34 loop_ = loop; |
| 35 } | 35 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 58 void NavigationCommitted( | 58 void NavigationCommitted( |
| 59 mojom::NavigationCommittedDetailsPtr details, | 59 mojom::NavigationCommittedDetailsPtr details, |
| 60 int current_index) override {} | 60 int current_index) override {} |
| 61 void NavigationEntryChanged(mojom::NavigationEntryPtr entry, | 61 void NavigationEntryChanged(mojom::NavigationEntryPtr entry, |
| 62 int entry_index) override {} | 62 int entry_index) override {} |
| 63 void NavigationListPruned(bool from_front, int count) override {} | 63 void NavigationListPruned(bool from_front, int count) override {} |
| 64 | 64 |
| 65 int load_count_ = 0; | 65 int load_count_ = 0; |
| 66 mojo::Binding<mojom::ViewClient> binding_; | 66 mojo::Binding<mojom::ViewClient> binding_; |
| 67 base::RunLoop* loop_ = nullptr; | 67 base::RunLoop* loop_ = nullptr; |
| 68 std::unique_ptr<shell::Connection> window_manager_connection_; | 68 std::unique_ptr<service_manager::Connection> window_manager_connection_; |
| 69 | 69 |
| 70 DISALLOW_COPY_AND_ASSIGN(NavigationTest); | 70 DISALLOW_COPY_AND_ASSIGN(NavigationTest); |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 // See crbug.com/619523 | 73 // See crbug.com/619523 |
| 74 TEST_F(NavigationTest, DISABLED_Navigate) { | 74 TEST_F(NavigationTest, DISABLED_Navigate) { |
| 75 mojom::ViewFactoryPtr view_factory; | 75 mojom::ViewFactoryPtr view_factory; |
| 76 connector()->ConnectToInterface("exe:navigation", &view_factory); | 76 connector()->ConnectToInterface("exe:navigation", &view_factory); |
| 77 | 77 |
| 78 mojom::ViewPtr view; | 78 mojom::ViewPtr view; |
| 79 view_factory->CreateView(GetViewClient(), GetProxy(&view)); | 79 view_factory->CreateView(GetViewClient(), GetProxy(&view)); |
| 80 view->NavigateTo(GURL("about:blank")); | 80 view->NavigateTo(GURL("about:blank")); |
| 81 | 81 |
| 82 base::RunLoop loop; | 82 base::RunLoop loop; |
| 83 QuitOnLoadingStateChange(&loop); | 83 QuitOnLoadingStateChange(&loop); |
| 84 loop.Run(); | 84 loop.Run(); |
| 85 } | 85 } |
| 86 | 86 |
| 87 } // namespace navigation | 87 } // namespace navigation |
| OLD | NEW |