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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/memory/scoped_vector.h" | 7 #include "base/memory/scoped_vector.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "mojo/public/cpp/application/application_delegate.h" | 9 #include "mojo/public/cpp/application/application_delegate.h" |
10 #include "mojo/public/cpp/application/application_impl.h" | 10 #include "mojo/public/cpp/application/application_impl.h" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 return window_manager_observer_.get(); | 171 return window_manager_observer_.get(); |
172 } | 172 } |
173 | 173 |
174 mojo::WindowManagerPtr window_manager_; | 174 mojo::WindowManagerPtr window_manager_; |
175 | 175 |
176 private: | 176 private: |
177 // Overridden from testing::Test: | 177 // Overridden from testing::Test: |
178 void SetUp() override { | 178 void SetUp() override { |
179 test_helper_.reset(new mojo::shell::ShellTestHelper); | 179 test_helper_.reset(new mojo::shell::ShellTestHelper); |
180 test_helper_->Init(); | 180 test_helper_->Init(); |
181 test_helper_->AddCustomMapping(GURL("mojo:window_manager"), | 181 test_helper_->AddURLMapping(GURL("mojo:window_manager"), |
182 GURL("mojo:core_window_manager")); | 182 GURL("mojo:core_window_manager")); |
183 test_helper_->SetLoaderForURL( | 183 test_helper_->SetLoaderForURL( |
184 scoped_ptr<mojo::ApplicationLoader>( | 184 scoped_ptr<mojo::ApplicationLoader>( |
185 new TestApplicationLoader(base::Bind( | 185 new TestApplicationLoader(base::Bind( |
186 &WindowManagerApiTest::OnRootAdded, base::Unretained(this)))), | 186 &WindowManagerApiTest::OnRootAdded, base::Unretained(this)))), |
187 GURL(kTestServiceURL)); | 187 GURL(kTestServiceURL)); |
188 ConnectToWindowManager2(); | 188 ConnectToWindowManager2(); |
189 } | 189 } |
190 void TearDown() override {} | 190 void TearDown() override {} |
191 | 191 |
192 void ConnectToWindowManager2() { | 192 void ConnectToWindowManager2() { |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 EXPECT_EQ(id, first_window); | 254 EXPECT_EQ(id, first_window); |
255 | 255 |
256 Id second_window = OpenWindow(); | 256 Id second_window = OpenWindow(); |
257 window_manager_->ActivateWindow(second_window, | 257 window_manager_->ActivateWindow(second_window, |
258 base::Bind(&EmptyResultCallback)); | 258 base::Bind(&EmptyResultCallback)); |
259 id = WaitForActiveWindowChange(); | 259 id = WaitForActiveWindowChange(); |
260 EXPECT_EQ(id, second_window); | 260 EXPECT_EQ(id, second_window); |
261 } | 261 } |
262 | 262 |
263 } // namespace window_manager | 263 } // namespace window_manager |
OLD | NEW |