OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 #include "chromeos/chromeos_switches.h" | 33 #include "chromeos/chromeos_switches.h" |
34 #include "chromeos/login/user_names.h" | 34 #include "chromeos/login/user_names.h" |
35 #endif // defined(OS_CHROMEOS) | 35 #endif // defined(OS_CHROMEOS) |
36 | 36 |
37 // Browser Test for AppListController that runs on all platforms supporting | 37 // Browser Test for AppListController that runs on all platforms supporting |
38 // app_list. | 38 // app_list. |
39 typedef InProcessBrowserTest AppListControllerBrowserTest; | 39 typedef InProcessBrowserTest AppListControllerBrowserTest; |
40 | 40 |
41 // Test the CreateNewWindow function of the controller delegate. | 41 // Test the CreateNewWindow function of the controller delegate. |
42 IN_PROC_BROWSER_TEST_F(AppListControllerBrowserTest, CreateNewWindow) { | 42 IN_PROC_BROWSER_TEST_F(AppListControllerBrowserTest, CreateNewWindow) { |
43 const chrome::HostDesktopType desktop = chrome::GetActiveDesktop(); | |
44 AppListService* service = test::GetAppListService(); | 43 AppListService* service = test::GetAppListService(); |
45 AppListControllerDelegate* controller(service->GetControllerDelegate()); | 44 AppListControllerDelegate* controller(service->GetControllerDelegate()); |
46 ASSERT_TRUE(controller); | 45 ASSERT_TRUE(controller); |
47 | 46 |
48 EXPECT_EQ(1U, chrome::GetBrowserCount(browser()->profile(), desktop)); | 47 EXPECT_EQ(1U, chrome::GetBrowserCount(browser()->profile())); |
49 EXPECT_EQ(0U, chrome::GetBrowserCount( | 48 EXPECT_EQ(0U, chrome::GetBrowserCount( |
50 browser()->profile()->GetOffTheRecordProfile(), desktop)); | 49 browser()->profile()->GetOffTheRecordProfile())); |
51 | 50 |
52 controller->CreateNewWindow(browser()->profile(), false); | 51 controller->CreateNewWindow(browser()->profile(), false); |
53 EXPECT_EQ(2U, chrome::GetBrowserCount(browser()->profile(), desktop)); | 52 EXPECT_EQ(2U, chrome::GetBrowserCount(browser()->profile())); |
54 | 53 |
55 controller->CreateNewWindow(browser()->profile(), true); | 54 controller->CreateNewWindow(browser()->profile(), true); |
56 EXPECT_EQ(1U, chrome::GetBrowserCount( | 55 EXPECT_EQ(1U, chrome::GetBrowserCount( |
57 browser()->profile()->GetOffTheRecordProfile(), desktop)); | 56 browser()->profile()->GetOffTheRecordProfile())); |
58 } | 57 } |
59 | 58 |
60 // Browser Test for AppListController that observes search result changes. | 59 // Browser Test for AppListController that observes search result changes. |
61 class AppListControllerSearchResultsBrowserTest | 60 class AppListControllerSearchResultsBrowserTest |
62 : public ExtensionBrowserTest, | 61 : public ExtensionBrowserTest, |
63 public app_list::SearchResultObserver, | 62 public app_list::SearchResultObserver, |
64 public ui::ListModelObserver { | 63 public ui::ListModelObserver { |
65 public: | 64 public: |
66 AppListControllerSearchResultsBrowserTest() | 65 AppListControllerSearchResultsBrowserTest() |
67 : observed_result_(NULL), | 66 : observed_result_(NULL), |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 // Test creating the initial app list in guest mode. | 199 // Test creating the initial app list in guest mode. |
201 IN_PROC_BROWSER_TEST_F(AppListControllerGuestModeBrowserTest, Incognito) { | 200 IN_PROC_BROWSER_TEST_F(AppListControllerGuestModeBrowserTest, Incognito) { |
202 AppListService* service = test::GetAppListService(); | 201 AppListService* service = test::GetAppListService(); |
203 EXPECT_TRUE(service->GetCurrentAppListProfile()); | 202 EXPECT_TRUE(service->GetCurrentAppListProfile()); |
204 | 203 |
205 service->ShowForProfile(browser()->profile()); | 204 service->ShowForProfile(browser()->profile()); |
206 EXPECT_EQ(browser()->profile(), service->GetCurrentAppListProfile()); | 205 EXPECT_EQ(browser()->profile(), service->GetCurrentAppListProfile()); |
207 } | 206 } |
208 | 207 |
209 #endif // defined(OS_CHROMEOS) | 208 #endif // defined(OS_CHROMEOS) |
OLD | NEW |