Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(247)

Side by Side Diff: ash/mus/app_launch_unittest.cc

Issue 2758323002: Broke out layout metric information from ViewsDelegate to LayoutProvider (Closed)
Patch Set: Final feedback addressed Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ash/test/ash_test_helper.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "ash/public/interfaces/constants.mojom.h" 5 #include "ash/public/interfaces/constants.mojom.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "mash/quick_launch/public/interfaces/constants.mojom.h" 9 #include "mash/quick_launch/public/interfaces/constants.mojom.h"
10 #include "services/service_manager/public/cpp/service_test.h" 10 #include "services/service_manager/public/cpp/service_test.h"
11 #include "services/ui/public/interfaces/constants.mojom.h" 11 #include "services/ui/public/interfaces/constants.mojom.h"
12 #include "services/ui/public/interfaces/window_server_test.mojom.h" 12 #include "services/ui/public/interfaces/window_server_test.mojom.h"
13 #include "ui/views/layout/layout_provider.h"
13 14
14 namespace ash { 15 namespace ash {
15 namespace mus { 16 namespace mus {
16 17
17 void RunCallback(bool* success, const base::Closure& callback, bool result) { 18 void RunCallback(bool* success, const base::Closure& callback, bool result) {
18 *success = result; 19 *success = result;
19 callback.Run(); 20 callback.Run();
20 } 21 }
21 22
22 class AppLaunchTest : public service_manager::test::ServiceTest { 23 class AppLaunchTest : public service_manager::test::ServiceTest {
23 public: 24 public:
24 AppLaunchTest() : ServiceTest("mash_unittests") {} 25 AppLaunchTest() : ServiceTest("mash_unittests") {}
25 ~AppLaunchTest() override {} 26 ~AppLaunchTest() override {}
26 27
27 private: 28 private:
28 void SetUp() override { 29 void SetUp() override {
29 base::CommandLine::ForCurrentProcess()->AppendSwitch("use-test-config"); 30 base::CommandLine::ForCurrentProcess()->AppendSwitch("use-test-config");
30 ServiceTest::SetUp(); 31 ServiceTest::SetUp();
31 } 32 }
32 33
34 views::LayoutProvider layout_provider_;
35
33 DISALLOW_COPY_AND_ASSIGN(AppLaunchTest); 36 DISALLOW_COPY_AND_ASSIGN(AppLaunchTest);
34 }; 37 };
35 38
36 TEST_F(AppLaunchTest, TestQuickLaunch) { 39 TEST_F(AppLaunchTest, TestQuickLaunch) {
37 connector()->StartService(mojom::kServiceName); 40 connector()->StartService(mojom::kServiceName);
38 connector()->StartService(mash::quick_launch::mojom::kServiceName); 41 connector()->StartService(mash::quick_launch::mojom::kServiceName);
39 42
40 ui::mojom::WindowServerTestPtr test_interface; 43 ui::mojom::WindowServerTestPtr test_interface;
41 connector()->BindInterface(ui::mojom::kServiceName, &test_interface); 44 connector()->BindInterface(ui::mojom::kServiceName, &test_interface);
42 45
43 base::RunLoop run_loop; 46 base::RunLoop run_loop;
44 bool success = false; 47 bool success = false;
45 test_interface->EnsureClientHasDrawnWindow( 48 test_interface->EnsureClientHasDrawnWindow(
46 mash::quick_launch::mojom::kServiceName, 49 mash::quick_launch::mojom::kServiceName,
47 base::Bind(&RunCallback, &success, run_loop.QuitClosure())); 50 base::Bind(&RunCallback, &success, run_loop.QuitClosure()));
48 run_loop.Run(); 51 run_loop.Run();
49 EXPECT_TRUE(success); 52 EXPECT_TRUE(success);
50 } 53 }
51 54
52 } // namespace mus 55 } // namespace mus
53 } // namespace ash 56 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/test/ash_test_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698