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

Side by Side Diff: chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc

Issue 757433004: Add SOURCE_TEST. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update existing browser tests to use the correct source. Created 6 years 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
OLDNEW
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 "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/display/display_controller.h" 8 #include "ash/display/display_controller.h"
9 #include "ash/shelf/shelf.h" 9 #include "ash/shelf/shelf.h"
10 #include "ash/shelf/shelf_button.h" 10 #include "ash/shelf/shelf_button.h"
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 extensions::LaunchContainer container, 215 extensions::LaunchContainer container,
216 WindowOpenDisposition disposition) { 216 WindowOpenDisposition disposition) {
217 EXPECT_TRUE(LoadExtension(test_data_dir_.AppendASCII(name))); 217 EXPECT_TRUE(LoadExtension(test_data_dir_.AppendASCII(name)));
218 218
219 ExtensionService* service = extensions::ExtensionSystem::Get( 219 ExtensionService* service = extensions::ExtensionSystem::Get(
220 profile())->extension_service(); 220 profile())->extension_service();
221 const Extension* extension = 221 const Extension* extension =
222 service->GetExtensionById(last_loaded_extension_id(), false); 222 service->GetExtensionById(last_loaded_extension_id(), false);
223 EXPECT_TRUE(extension); 223 EXPECT_TRUE(extension);
224 224
225 OpenApplication(AppLaunchParams(profile(), extension, container, 225 OpenApplication(
226 disposition, extensions::SOURCE_UNTRACKED)); 226 AppLaunchParams(profile(), extension, container,
227 disposition, extensions::SOURCE_BROWSER_TEST));
227 return extension; 228 return extension;
228 } 229 }
229 230
230 ash::ShelfID CreateShortcut(const char* name) { 231 ash::ShelfID CreateShortcut(const char* name) {
231 ExtensionService* service = extensions::ExtensionSystem::Get( 232 ExtensionService* service = extensions::ExtensionSystem::Get(
232 profile())->extension_service(); 233 profile())->extension_service();
233 LoadExtension(test_data_dir_.AppendASCII(name)); 234 LoadExtension(test_data_dir_.AppendASCII(name));
234 235
235 // First get app_id. 236 // First get app_id.
236 const Extension* extension = 237 const Extension* extension =
(...skipping 1835 matching lines...) Expand 10 before | Expand all | Expand 10 after
2072 // We assume that the web store is always there (which it apparently is). 2073 // We assume that the web store is always there (which it apparently is).
2073 controller_->PinAppWithID(extensions::kWebStoreAppId); 2074 controller_->PinAppWithID(extensions::kWebStoreAppId);
2074 ash::ShelfID id = controller_->GetShelfIDForAppID( 2075 ash::ShelfID id = controller_->GetShelfIDForAppID(
2075 extensions::kWebStoreAppId); 2076 extensions::kWebStoreAppId);
2076 ASSERT_NE(0, id); 2077 ASSERT_NE(0, id);
2077 EXPECT_EQ(ash::STATUS_CLOSED, model_->ItemByID(id)->status); 2078 EXPECT_EQ(ash::STATUS_CLOSED, model_->ItemByID(id)->status);
2078 2079
2079 // Create a windowed application. 2080 // Create a windowed application.
2080 AppLaunchParams params( 2081 AppLaunchParams params(
2081 profile(), controller_->GetExtensionForAppID(extensions::kWebStoreAppId), 2082 profile(), controller_->GetExtensionForAppID(extensions::kWebStoreAppId),
2082 CURRENT_TAB, chrome::HOST_DESKTOP_TYPE_ASH, extensions::SOURCE_UNTRACKED); 2083 CURRENT_TAB, chrome::HOST_DESKTOP_TYPE_ASH,
2084 extensions::SOURCE_BROWSER_TEST);
2083 params.container = extensions::LAUNCH_CONTAINER_WINDOW; 2085 params.container = extensions::LAUNCH_CONTAINER_WINDOW;
2084 OpenApplication(params); 2086 OpenApplication(params);
2085 EXPECT_EQ(ash::STATUS_ACTIVE, model_->ItemByID(id)->status); 2087 EXPECT_EQ(ash::STATUS_ACTIVE, model_->ItemByID(id)->status);
2086 2088
2087 // Find the browser which holds our app. 2089 // Find the browser which holds our app.
2088 Browser* app_browser = NULL; 2090 Browser* app_browser = NULL;
2089 const BrowserList* ash_browser_list = 2091 const BrowserList* ash_browser_list =
2090 BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_ASH); 2092 BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_ASH);
2091 for (BrowserList::const_reverse_iterator it = 2093 for (BrowserList::const_reverse_iterator it =
2092 ash_browser_list->begin_last_active(); 2094 ash_browser_list->begin_last_active();
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
2128 chrome::GetSettingsUrl(std::string())); 2130 chrome::GetSettingsUrl(std::string()));
2129 Browser* settings_browser = 2131 Browser* settings_browser =
2130 settings_manager->FindBrowserForProfile(browser()->profile()); 2132 settings_manager->FindBrowserForProfile(browser()->profile());
2131 ASSERT_TRUE(settings_browser); 2133 ASSERT_TRUE(settings_browser);
2132 EXPECT_EQ(browser_count, NumberOfDetectedLauncherBrowsers(false)); 2134 EXPECT_EQ(browser_count, NumberOfDetectedLauncherBrowsers(false));
2133 EXPECT_EQ(item_count + 1, shelf_model->item_count()); 2135 EXPECT_EQ(item_count + 1, shelf_model->item_count());
2134 2136
2135 // TODO(stevenjb): Test multiprofile on Chrome OS when test support is addded. 2137 // TODO(stevenjb): Test multiprofile on Chrome OS when test support is addded.
2136 // crbug.com/230464. 2138 // crbug.com/230464.
2137 } 2139 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698