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/shell/public/cpp/shell_client.h" | 10 #include "services/shell/public/cpp/shell_client.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 bool can_go_back, | 46 bool can_go_back, |
47 bool can_go_forward) override {} | 47 bool can_go_forward) override {} |
48 void LoadProgressChanged(double progress) override {} | 48 void LoadProgressChanged(double progress) override {} |
49 void UpdateHoverURL(const GURL& url) override {} | 49 void UpdateHoverURL(const GURL& url) override {} |
50 void ViewCreated(mojom::ViewPtr, | 50 void ViewCreated(mojom::ViewPtr, |
51 mojom::ViewClientRequest, | 51 mojom::ViewClientRequest, |
52 bool, | 52 bool, |
53 const gfx::Rect&, | 53 const gfx::Rect&, |
54 bool) override {} | 54 bool) override {} |
55 void Close() override {} | 55 void Close() override {} |
| 56 void NavigationPending(mojom::NavigationEntryPtr entry) override {} |
| 57 void NavigationCommitted( |
| 58 mojom::NavigationCommittedDetailsPtr details, |
| 59 int current_index) override {} |
| 60 void NavigationEntryChanged(mojom::NavigationEntryPtr entry, |
| 61 int entry_index) override {} |
| 62 void NavigationListPruned(bool from_front, int count) override {} |
56 | 63 |
57 int load_count_ = 0; | 64 int load_count_ = 0; |
58 mojo::Binding<mojom::ViewClient> binding_; | 65 mojo::Binding<mojom::ViewClient> binding_; |
59 base::RunLoop* loop_ = nullptr; | 66 base::RunLoop* loop_ = nullptr; |
60 std::unique_ptr<shell::Connection> window_manager_connection_; | 67 std::unique_ptr<shell::Connection> window_manager_connection_; |
61 | 68 |
62 DISALLOW_COPY_AND_ASSIGN(NavigationTest); | 69 DISALLOW_COPY_AND_ASSIGN(NavigationTest); |
63 }; | 70 }; |
64 | 71 |
65 TEST_F(NavigationTest, Navigate) { | 72 TEST_F(NavigationTest, Navigate) { |
66 mojom::ViewFactoryPtr view_factory; | 73 mojom::ViewFactoryPtr view_factory; |
67 connector()->ConnectToInterface("exe:navigation", &view_factory); | 74 connector()->ConnectToInterface("exe:navigation", &view_factory); |
68 | 75 |
69 mojom::ViewPtr view; | 76 mojom::ViewPtr view; |
70 view_factory->CreateView(GetViewClient(), GetProxy(&view)); | 77 view_factory->CreateView(GetViewClient(), GetProxy(&view)); |
71 view->NavigateTo(GURL("about:blank")); | 78 view->NavigateTo(GURL("about:blank")); |
72 | 79 |
73 base::RunLoop loop; | 80 base::RunLoop loop; |
74 QuitOnLoadingStateChange(&loop); | 81 QuitOnLoadingStateChange(&loop); |
75 loop.Run(); | 82 loop.Run(); |
76 } | 83 } |
77 | 84 |
78 } // namespace navigation | 85 } // namespace navigation |
OLD | NEW |