OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "chrome/browser/profiles/profile_window.h" | 5 #include "chrome/browser/profiles/profile_window.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 FILE_PATH_LITERAL("profile_window_browsertest.js"))); | 250 FILE_PATH_LITERAL("profile_window_browsertest.js"))); |
251 } | 251 } |
252 }; | 252 }; |
253 | 253 |
254 IN_PROC_BROWSER_TEST_F(ProfileWindowWebUIBrowserTest, | 254 IN_PROC_BROWSER_TEST_F(ProfileWindowWebUIBrowserTest, |
255 UserManagerFocusSingleProfile) { | 255 UserManagerFocusSingleProfile) { |
256 std::string url_to_test; | 256 std::string url_to_test; |
257 base::RunLoop run_loop; | 257 base::RunLoop run_loop; |
258 profiles::CreateSystemProfileForUserManager( | 258 profiles::CreateSystemProfileForUserManager( |
259 browser()->profile()->GetPath(), | 259 browser()->profile()->GetPath(), |
260 profiles::USER_MANAGER_NO_TUTORIAL, | |
261 profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION, | 260 profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION, |
262 base::Bind(&ProfileWindowWebUIBrowserTest::OnSystemProfileCreated, | 261 base::Bind(&ProfileWindowWebUIBrowserTest::OnSystemProfileCreated, |
263 base::Unretained(this), | 262 base::Unretained(this), |
264 &url_to_test, | 263 &url_to_test, |
265 run_loop.QuitClosure())); | 264 run_loop.QuitClosure())); |
266 run_loop.Run(); | 265 run_loop.Run(); |
267 | 266 |
268 ui_test_utils::NavigateToURL(browser(), GURL(url_to_test)); | 267 ui_test_utils::NavigateToURL(browser(), GURL(url_to_test)); |
269 EXPECT_TRUE(RunJavascriptTest("testNoPodFocused")); | 268 EXPECT_TRUE(RunJavascriptTest("testNoPodFocused")); |
270 } | 269 } |
271 | 270 |
272 // This test is flaky, see https://crbug.com/611619. | 271 // This test is flaky, see https://crbug.com/611619. |
273 IN_PROC_BROWSER_TEST_F(ProfileWindowWebUIBrowserTest, | 272 IN_PROC_BROWSER_TEST_F(ProfileWindowWebUIBrowserTest, |
274 DISABLED_UserManagerFocusMultipleProfiles) { | 273 DISABLED_UserManagerFocusMultipleProfiles) { |
275 // The profile names are meant to sort differently by ICU collation and by | 274 // The profile names are meant to sort differently by ICU collation and by |
276 // naive sorting. See crbug/596280. | 275 // naive sorting. See crbug/596280. |
277 base::FilePath expected_path = CreateTestingProfile("#abc", "Profile 1"); | 276 base::FilePath expected_path = CreateTestingProfile("#abc", "Profile 1"); |
278 CreateTestingProfile("?abc", "Profile 2"); | 277 CreateTestingProfile("?abc", "Profile 2"); |
279 | 278 |
280 std::string url_to_test; | 279 std::string url_to_test; |
281 base::RunLoop run_loop; | 280 base::RunLoop run_loop; |
282 profiles::CreateSystemProfileForUserManager( | 281 profiles::CreateSystemProfileForUserManager( |
283 expected_path, | 282 expected_path, |
284 profiles::USER_MANAGER_NO_TUTORIAL, | |
285 profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION, | 283 profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION, |
286 base::Bind(&ProfileWindowWebUIBrowserTest::OnSystemProfileCreated, | 284 base::Bind(&ProfileWindowWebUIBrowserTest::OnSystemProfileCreated, |
287 base::Unretained(this), | 285 base::Unretained(this), |
288 &url_to_test, | 286 &url_to_test, |
289 run_loop.QuitClosure())); | 287 run_loop.QuitClosure())); |
290 run_loop.Run(); | 288 run_loop.Run(); |
291 | 289 |
292 ui_test_utils::NavigateToURL(browser(), GURL(url_to_test)); | 290 ui_test_utils::NavigateToURL(browser(), GURL(url_to_test)); |
293 EXPECT_TRUE(RunJavascriptTest("testPodFocused", | 291 EXPECT_TRUE(RunJavascriptTest("testPodFocused", |
294 base::Value(expected_path.AsUTF8Unsafe()))); | 292 base::Value(expected_path.AsUTF8Unsafe()))); |
295 } | 293 } |
296 | 294 |
297 #endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID) | 295 #endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID) |
OLD | NEW |