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

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

Issue 18850003: Focus kept on login screen. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Test fixed. Created 7 years, 5 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
« no previous file with comments | « ash/wm/event_client_impl.cc ('k') | chrome/test/base/view_event_test_base.cc » ('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 (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/command_line.h" 10 #include "base/command_line.h"
(...skipping 17 matching lines...) Expand all
28 #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h" 28 #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h"
29 #include "chrome/browser/lifetime/application_lifetime.h" 29 #include "chrome/browser/lifetime/application_lifetime.h"
30 #include "chrome/browser/policy/cloud/cloud_policy_constants.h" 30 #include "chrome/browser/policy/cloud/cloud_policy_constants.h"
31 #include "chrome/browser/policy/cloud/policy_builder.h" 31 #include "chrome/browser/policy/cloud/policy_builder.h"
32 #include "chrome/browser/policy/policy_service.h" 32 #include "chrome/browser/policy/policy_service.h"
33 #include "chrome/browser/policy/proto/chromeos/chrome_device_policy.pb.h" 33 #include "chrome/browser/policy/proto/chromeos/chrome_device_policy.pb.h"
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/browser_list.h"
38 #include "chrome/browser/ui/host_desktop.h" 39 #include "chrome/browser/ui/host_desktop.h"
39 #include "chrome/browser/ui/tabs/tab_strip_model.h" 40 #include "chrome/browser/ui/tabs/tab_strip_model.h"
40 #include "chrome/common/chrome_switches.h" 41 #include "chrome/common/chrome_switches.h"
41 #include "chromeos/chromeos_switches.h" 42 #include "chromeos/chromeos_switches.h"
42 #include "chromeos/dbus/cryptohome_client.h" 43 #include "chromeos/dbus/cryptohome_client.h"
43 #include "chromeos/dbus/dbus_method_call_status.h" 44 #include "chromeos/dbus/dbus_method_call_status.h"
44 #include "chromeos/dbus/fake_cryptohome_client.h" 45 #include "chromeos/dbus/fake_cryptohome_client.h"
45 #include "chromeos/dbus/fake_session_manager_client.h" 46 #include "chromeos/dbus/fake_session_manager_client.h"
46 #include "chromeos/dbus/session_manager_client.h" 47 #include "chromeos/dbus/session_manager_client.h"
47 #include "content/public/browser/web_contents.h" 48 #include "content/public/browser/web_contents.h"
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 chromeos::ExistingUserController* controller = 326 chromeos::ExistingUserController* controller =
326 chromeos::ExistingUserController::current_controller(); 327 chromeos::ExistingUserController::current_controller();
327 ASSERT_TRUE(controller); 328 ASSERT_TRUE(controller);
328 controller->LoginAsPublicAccount(user_id_1_); 329 controller->LoginAsPublicAccount(user_id_1_);
329 330
330 // Wait for the session to start. 331 // Wait for the session to start.
331 content::WindowedNotificationObserver(chrome::NOTIFICATION_SESSION_STARTED, 332 content::WindowedNotificationObserver(chrome::NOTIFICATION_SESSION_STARTED,
332 base::Bind(IsSessionStarted)).Wait(); 333 base::Bind(IsSessionStarted)).Wait();
333 334
334 // Check that the startup pages specified in policy were opened. 335 // Check that the startup pages specified in policy were opened.
335 EXPECT_EQ(1U, chrome::GetTotalBrowserCount()); 336 BrowserList* browser_list =
336 Browser* browser = 337 BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_ASH);
337 chrome::FindLastActiveWithHostDesktopType(chrome::HOST_DESKTOP_TYPE_ASH); 338 EXPECT_EQ(1U, browser_list->size());
339 Browser* browser = browser_list->get(0);
338 ASSERT_TRUE(browser); 340 ASSERT_TRUE(browser);
339 341
340 TabStripModel* tabs = browser->tab_strip_model(); 342 TabStripModel* tabs = browser->tab_strip_model();
341 ASSERT_TRUE(tabs); 343 ASSERT_TRUE(tabs);
342 int expected_tab_count = static_cast<int>(arraysize(kStartupURLs)); 344 int expected_tab_count = static_cast<int>(arraysize(kStartupURLs));
343 EXPECT_EQ(expected_tab_count, tabs->count()); 345 EXPECT_EQ(expected_tab_count, tabs->count());
344 for (int i = 0; i < expected_tab_count && i < tabs->count(); ++i) 346 for (int i = 0; i < expected_tab_count && i < tabs->count(); ++i)
345 EXPECT_EQ(GURL(kStartupURLs[i]), tabs->GetWebContentsAt(i)->GetURL()); 347 EXPECT_EQ(GURL(kStartupURLs[i]), tabs->GetWebContentsAt(i)->GetURL());
346 } 348 }
347 349
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 // Verify that the Terms of Service screen is being shown. 386 // Verify that the Terms of Service screen is being shown.
385 chromeos::WizardController* wizard_controller = 387 chromeos::WizardController* wizard_controller =
386 chromeos::WizardController::default_controller(); 388 chromeos::WizardController::default_controller();
387 ASSERT_TRUE(wizard_controller); 389 ASSERT_TRUE(wizard_controller);
388 ASSERT_TRUE(wizard_controller->current_screen()); 390 ASSERT_TRUE(wizard_controller->current_screen());
389 EXPECT_EQ(chromeos::WizardController::kTermsOfServiceScreenName, 391 EXPECT_EQ(chromeos::WizardController::kTermsOfServiceScreenName,
390 wizard_controller->current_screen()->GetName()); 392 wizard_controller->current_screen()->GetName());
391 } 393 }
392 394
393 } // namespace policy 395 } // namespace policy
OLDNEW
« no previous file with comments | « ash/wm/event_client_impl.cc ('k') | chrome/test/base/view_event_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698