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

Side by Side Diff: chrome/browser/chromeos/policy/device_local_account_browsertest.cc

Issue 13671005: Re-apply 192420: Move login switches to src/chromeos (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 <map> 5 #include <map>
6 #include <string> 6 #include <string>
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 23 matching lines...) Expand all
34 #include "chrome/browser/policy/test/local_policy_test_server.h" 34 #include "chrome/browser/policy/test/local_policy_test_server.h"
35 #include "chrome/browser/prefs/session_startup_pref.h" 35 #include "chrome/browser/prefs/session_startup_pref.h"
36 #include "chrome/browser/ui/browser.h" 36 #include "chrome/browser/ui/browser.h"
37 #include "chrome/browser/ui/browser_finder.h" 37 #include "chrome/browser/ui/browser_finder.h"
38 #include "chrome/browser/ui/host_desktop.h" 38 #include "chrome/browser/ui/host_desktop.h"
39 #include "chrome/browser/ui/tabs/tab_strip_model.h" 39 #include "chrome/browser/ui/tabs/tab_strip_model.h"
40 #include "chrome/common/chrome_notification_types.h" 40 #include "chrome/common/chrome_notification_types.h"
41 #include "chrome/common/chrome_paths.h" 41 #include "chrome/common/chrome_paths.h"
42 #include "chrome/common/chrome_switches.h" 42 #include "chrome/common/chrome_switches.h"
43 #include "chrome/test/base/in_process_browser_test.h" 43 #include "chrome/test/base/in_process_browser_test.h"
44 #include "chromeos/chromeos_switches.h"
44 #include "chromeos/dbus/cryptohome_client.h" 45 #include "chromeos/dbus/cryptohome_client.h"
45 #include "chromeos/dbus/dbus_method_call_status.h" 46 #include "chromeos/dbus/dbus_method_call_status.h"
46 #include "chromeos/dbus/dbus_thread_manager.h" 47 #include "chromeos/dbus/dbus_thread_manager.h"
47 #include "chromeos/dbus/mock_dbus_thread_manager.h" 48 #include "chromeos/dbus/mock_dbus_thread_manager.h"
48 #include "chromeos/dbus/mock_update_engine_client.h" 49 #include "chromeos/dbus/mock_update_engine_client.h"
49 #include "chromeos/dbus/session_manager_client.h" 50 #include "chromeos/dbus/session_manager_client.h"
50 #include "content/public/browser/notification_observer.h" 51 #include "content/public/browser/notification_observer.h"
51 #include "content/public/browser/notification_registrar.h" 52 #include "content/public/browser/notification_registrar.h"
52 #include "content/public/browser/notification_service.h" 53 #include "content/public/browser/notification_service.h"
53 #include "content/public/browser/web_contents.h" 54 #include "content/public/browser/web_contents.h"
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 ASSERT_TRUE(test_server_.SetSigningKey(signing_key.get())); 377 ASSERT_TRUE(test_server_.SetSigningKey(signing_key.get()));
377 signing_key.reset(); 378 signing_key.reset();
378 test_server_.RegisterClient(PolicyBuilder::kFakeToken, 379 test_server_.RegisterClient(PolicyBuilder::kFakeToken,
379 PolicyBuilder::kFakeDeviceId); 380 PolicyBuilder::kFakeDeviceId);
380 ASSERT_TRUE(test_server_.Start()); 381 ASSERT_TRUE(test_server_.Start());
381 382
382 InProcessBrowserTest::SetUp(); 383 InProcessBrowserTest::SetUp();
383 } 384 }
384 385
385 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { 386 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
386 command_line->AppendSwitch(switches::kLoginManager); 387 command_line->AppendSwitch(chromeos::switches::kLoginManager);
387 command_line->AppendSwitch(switches::kForceLoginManagerInTests); 388 command_line->AppendSwitch(chromeos::switches::kForceLoginManagerInTests);
388 command_line->AppendSwitchASCII( 389 command_line->AppendSwitchASCII(
389 switches::kLoginScreen, chromeos::WizardController::kLoginScreenName); 390 chromeos::switches::kLoginScreen,
391 chromeos::WizardController::kLoginScreenName);
390 command_line->AppendSwitchASCII( 392 command_line->AppendSwitchASCII(
391 switches::kDeviceManagementUrl, test_server_.GetServiceURL().spec()); 393 switches::kDeviceManagementUrl, test_server_.GetServiceURL().spec());
392 command_line->AppendSwitchASCII( 394 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, "user");
393 switches::kLoginProfile, "user");
394 } 395 }
395 396
396 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { 397 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE {
397 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); 398 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
398 399
399 // Clear command-line arguments (but keep command-line switches) so the 400 // Clear command-line arguments (but keep command-line switches) so the
400 // startup pages policy takes effect. 401 // startup pages policy takes effect.
401 CommandLine* command_line = CommandLine::ForCurrentProcess(); 402 CommandLine* command_line = CommandLine::ForCurrentProcess();
402 CommandLine::StringVector argv(command_line->argv()); 403 CommandLine::StringVector argv(command_line->argv());
403 argv.erase(argv.begin() + argv.size() - command_line->GetArgs().size(), 404 argv.erase(argv.begin() + argv.size() - command_line->GetArgs().size(),
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 632
632 TabStripModel* tabs = browser->tab_strip_model(); 633 TabStripModel* tabs = browser->tab_strip_model();
633 ASSERT_TRUE(tabs); 634 ASSERT_TRUE(tabs);
634 int expected_tab_count = static_cast<int>(arraysize(kStartupURLs)); 635 int expected_tab_count = static_cast<int>(arraysize(kStartupURLs));
635 EXPECT_EQ(expected_tab_count, tabs->count()); 636 EXPECT_EQ(expected_tab_count, tabs->count());
636 for (int i = 0; i < expected_tab_count && i < tabs->count(); ++i) 637 for (int i = 0; i < expected_tab_count && i < tabs->count(); ++i)
637 EXPECT_EQ(GURL(kStartupURLs[i]), tabs->GetWebContentsAt(i)->GetURL()); 638 EXPECT_EQ(GURL(kStartupURLs[i]), tabs->GetWebContentsAt(i)->GetURL());
638 } 639 }
639 640
640 } // namespace policy 641 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/wizard_in_process_browser_test.cc ('k') | chrome/browser/chromeos/preferences.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698