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 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/browser/chromeos/policy/login_policy_test_base.h" | 10 #include "chrome/browser/chromeos/policy/login_policy_test_base.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 dict->SetInteger(key::kRestoreOnStartup, | 31 dict->SetInteger(key::kRestoreOnStartup, |
32 SessionStartupPref::kPrefValueURLs); | 32 SessionStartupPref::kPrefValueURLs); |
33 | 33 |
34 return dict; | 34 return dict; |
35 } | 35 } |
36 | 36 |
37 private: | 37 private: |
38 DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyManagerTest); | 38 DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyManagerTest); |
39 }; | 39 }; |
40 | 40 |
41 IN_PROC_BROWSER_TEST_F(UserCloudPolicyManagerTest, StartSession) { | 41 IN_PROC_BROWSER_TEST_P(UserCloudPolicyManagerTest, StartSession) { |
42 const char* const kStartupURLs[] = {"chrome://policy", "chrome://about"}; | 42 const char* const kStartupURLs[] = {"chrome://policy", "chrome://about"}; |
43 | 43 |
44 SkipToLoginScreen(); | 44 SkipToLoginScreen(); |
45 LogIn(kAccountId, kAccountPassword); | 45 LogIn(kAccountId, kAccountPassword); |
46 | 46 |
47 // Check that the startup pages specified in policy were opened. | 47 // Check that the startup pages specified in policy were opened. |
48 BrowserList* browser_list = | 48 BrowserList* browser_list = |
49 BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_ASH); | 49 BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_ASH); |
50 EXPECT_EQ(1U, browser_list->size()); | 50 EXPECT_EQ(1U, browser_list->size()); |
51 Browser* browser = browser_list->get(0); | 51 Browser* browser = browser_list->get(0); |
52 ASSERT_TRUE(browser); | 52 ASSERT_TRUE(browser); |
53 | 53 |
54 TabStripModel* tabs = browser->tab_strip_model(); | 54 TabStripModel* tabs = browser->tab_strip_model(); |
55 ASSERT_TRUE(tabs); | 55 ASSERT_TRUE(tabs); |
56 const int expected_tab_count = static_cast<int>(arraysize(kStartupURLs)); | 56 const int expected_tab_count = static_cast<int>(arraysize(kStartupURLs)); |
57 EXPECT_EQ(expected_tab_count, tabs->count()); | 57 EXPECT_EQ(expected_tab_count, tabs->count()); |
58 for (int i = 0; i < expected_tab_count && i < tabs->count(); ++i) { | 58 for (int i = 0; i < expected_tab_count && i < tabs->count(); ++i) { |
59 EXPECT_EQ(GURL(kStartupURLs[i]), | 59 EXPECT_EQ(GURL(kStartupURLs[i]), |
60 tabs->GetWebContentsAt(i)->GetVisibleURL()); | 60 tabs->GetWebContentsAt(i)->GetVisibleURL()); |
61 } | 61 } |
62 } | 62 } |
63 | 63 |
| 64 // TODO(nkostylev): Fix this test for webview. http://crbug.com/477402 |
| 65 INSTANTIATE_TEST_CASE_P(UserCloudPolicyManagerTestSuite, |
| 66 UserCloudPolicyManagerTest, |
| 67 testing::Values(false)); |
| 68 |
64 } // namespace policy | 69 } // namespace policy |
OLD | NEW |