OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <string> | 5 #include <string> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyManagerTest); | 36 DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyManagerTest); |
37 }; | 37 }; |
38 | 38 |
39 IN_PROC_BROWSER_TEST_F(UserCloudPolicyManagerTest, StartSession) { | 39 IN_PROC_BROWSER_TEST_F(UserCloudPolicyManagerTest, StartSession) { |
40 const char* const kStartupURLs[] = {"chrome://policy", "chrome://about"}; | 40 const char* const kStartupURLs[] = {"chrome://policy", "chrome://about"}; |
41 | 41 |
42 SkipToLoginScreen(); | 42 SkipToLoginScreen(); |
43 LogIn(kAccountId, kAccountPassword); | 43 LogIn(kAccountId, kAccountPassword); |
44 | 44 |
45 // Check that the startup pages specified in policy were opened. | 45 // Check that the startup pages specified in policy were opened. |
46 BrowserList* browser_list = | 46 BrowserList* browser_list = BrowserList::GetInstance(); |
47 BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_ASH); | |
48 EXPECT_EQ(1U, browser_list->size()); | 47 EXPECT_EQ(1U, browser_list->size()); |
49 Browser* browser = browser_list->get(0); | 48 Browser* browser = browser_list->get(0); |
50 ASSERT_TRUE(browser); | 49 ASSERT_TRUE(browser); |
51 | 50 |
52 TabStripModel* tabs = browser->tab_strip_model(); | 51 TabStripModel* tabs = browser->tab_strip_model(); |
53 ASSERT_TRUE(tabs); | 52 ASSERT_TRUE(tabs); |
54 const int expected_tab_count = static_cast<int>(arraysize(kStartupURLs)); | 53 const int expected_tab_count = static_cast<int>(arraysize(kStartupURLs)); |
55 EXPECT_EQ(expected_tab_count, tabs->count()); | 54 EXPECT_EQ(expected_tab_count, tabs->count()); |
56 for (int i = 0; i < expected_tab_count && i < tabs->count(); ++i) { | 55 for (int i = 0; i < expected_tab_count && i < tabs->count(); ++i) { |
57 EXPECT_EQ(GURL(kStartupURLs[i]), | 56 EXPECT_EQ(GURL(kStartupURLs[i]), |
58 tabs->GetWebContentsAt(i)->GetVisibleURL()); | 57 tabs->GetWebContentsAt(i)->GetVisibleURL()); |
59 } | 58 } |
60 } | 59 } |
61 | 60 |
62 } // namespace policy | 61 } // namespace policy |
OLD | NEW |