OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <algorithm> | 5 #include <algorithm> |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 1497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1508 UpdateProviderPolicy(policies); | 1508 UpdateProviderPolicy(policies); |
1509 EXPECT_TRUE(chrome::ExecuteCommand(browser(), IDC_HOME)); | 1509 EXPECT_TRUE(chrome::ExecuteCommand(browser(), IDC_HOME)); |
1510 content::WaitForLoadStop(contents); | 1510 content::WaitForLoadStop(contents); |
1511 EXPECT_EQ(GURL(chrome::kChromeUICreditsURL), contents->GetURL()); | 1511 EXPECT_EQ(GURL(chrome::kChromeUICreditsURL), contents->GetURL()); |
1512 | 1512 |
1513 policies.Set(key::kHomepageIsNewTabPage, POLICY_LEVEL_MANDATORY, | 1513 policies.Set(key::kHomepageIsNewTabPage, POLICY_LEVEL_MANDATORY, |
1514 POLICY_SCOPE_USER, base::Value::CreateBooleanValue(true), NULL); | 1514 POLICY_SCOPE_USER, base::Value::CreateBooleanValue(true), NULL); |
1515 UpdateProviderPolicy(policies); | 1515 UpdateProviderPolicy(policies); |
1516 EXPECT_TRUE(chrome::ExecuteCommand(browser(), IDC_HOME)); | 1516 EXPECT_TRUE(chrome::ExecuteCommand(browser(), IDC_HOME)); |
1517 content::WaitForLoadStop(contents); | 1517 content::WaitForLoadStop(contents); |
1518 EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), contents->GetURL()); | 1518 EXPECT_TRUE(chrome::IsNTPURL(contents->GetURL(),browser()->profile())); |
1519 } | 1519 } |
1520 | 1520 |
1521 IN_PROC_BROWSER_TEST_F(PolicyTest, IncognitoEnabled) { | 1521 IN_PROC_BROWSER_TEST_F(PolicyTest, IncognitoEnabled) { |
1522 // Verifies that incognito windows can't be opened when disabled by policy. | 1522 // Verifies that incognito windows can't be opened when disabled by policy. |
1523 | 1523 |
1524 const BrowserList* active_browser_list = | 1524 const BrowserList* active_browser_list = |
1525 BrowserList::GetInstance(chrome::GetActiveDesktop()); | 1525 BrowserList::GetInstance(chrome::GetActiveDesktop()); |
1526 | 1526 |
1527 // Disable incognito via policy and verify that incognito windows can't be | 1527 // Disable incognito via policy and verify that incognito windows can't be |
1528 // opened. | 1528 // opened. |
(...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2502 chrome_variations::VariationsService::GetVariationsServerURL( | 2502 chrome_variations::VariationsService::GetVariationsServerURL( |
2503 g_browser_process->local_state()); | 2503 g_browser_process->local_state()); |
2504 EXPECT_TRUE(StartsWithASCII(url.spec(), default_variations_url, true)); | 2504 EXPECT_TRUE(StartsWithASCII(url.spec(), default_variations_url, true)); |
2505 std::string value; | 2505 std::string value; |
2506 EXPECT_TRUE(net::GetValueForKeyInQuery(url, "restrict", &value)); | 2506 EXPECT_TRUE(net::GetValueForKeyInQuery(url, "restrict", &value)); |
2507 EXPECT_EQ("restricted", value); | 2507 EXPECT_EQ("restricted", value); |
2508 } | 2508 } |
2509 #endif | 2509 #endif |
2510 | 2510 |
2511 } // namespace policy | 2511 } // namespace policy |
OLD | NEW |