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 1601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1612 UpdateProviderPolicy(policies); | 1612 UpdateProviderPolicy(policies); |
1613 EXPECT_TRUE(chrome::ExecuteCommand(browser(), IDC_HOME)); | 1613 EXPECT_TRUE(chrome::ExecuteCommand(browser(), IDC_HOME)); |
1614 content::WaitForLoadStop(contents); | 1614 content::WaitForLoadStop(contents); |
1615 EXPECT_EQ(GURL(chrome::kChromeUICreditsURL), contents->GetURL()); | 1615 EXPECT_EQ(GURL(chrome::kChromeUICreditsURL), contents->GetURL()); |
1616 | 1616 |
1617 policies.Set(key::kHomepageIsNewTabPage, POLICY_LEVEL_MANDATORY, | 1617 policies.Set(key::kHomepageIsNewTabPage, POLICY_LEVEL_MANDATORY, |
1618 POLICY_SCOPE_USER, base::Value::CreateBooleanValue(true), NULL); | 1618 POLICY_SCOPE_USER, base::Value::CreateBooleanValue(true), NULL); |
1619 UpdateProviderPolicy(policies); | 1619 UpdateProviderPolicy(policies); |
1620 EXPECT_TRUE(chrome::ExecuteCommand(browser(), IDC_HOME)); | 1620 EXPECT_TRUE(chrome::ExecuteCommand(browser(), IDC_HOME)); |
1621 content::WaitForLoadStop(contents); | 1621 content::WaitForLoadStop(contents); |
1622 EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), contents->GetURL()); | 1622 EXPECT_TRUE(chrome::IsNTPURL(contents->GetURL(),browser()->profile())); |
1623 } | 1623 } |
1624 | 1624 |
1625 IN_PROC_BROWSER_TEST_F(PolicyTest, IncognitoEnabled) { | 1625 IN_PROC_BROWSER_TEST_F(PolicyTest, IncognitoEnabled) { |
1626 // Verifies that incognito windows can't be opened when disabled by policy. | 1626 // Verifies that incognito windows can't be opened when disabled by policy. |
1627 | 1627 |
1628 const BrowserList* active_browser_list = | 1628 const BrowserList* active_browser_list = |
1629 BrowserList::GetInstance(chrome::GetActiveDesktop()); | 1629 BrowserList::GetInstance(chrome::GetActiveDesktop()); |
1630 | 1630 |
1631 // Disable incognito via policy and verify that incognito windows can't be | 1631 // Disable incognito via policy and verify that incognito windows can't be |
1632 // opened. | 1632 // opened. |
(...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2606 chrome_variations::VariationsService::GetVariationsServerURL( | 2606 chrome_variations::VariationsService::GetVariationsServerURL( |
2607 g_browser_process->local_state()); | 2607 g_browser_process->local_state()); |
2608 EXPECT_TRUE(StartsWithASCII(url.spec(), default_variations_url, true)); | 2608 EXPECT_TRUE(StartsWithASCII(url.spec(), default_variations_url, true)); |
2609 std::string value; | 2609 std::string value; |
2610 EXPECT_TRUE(net::GetValueForKeyInQuery(url, "restrict", &value)); | 2610 EXPECT_TRUE(net::GetValueForKeyInQuery(url, "restrict", &value)); |
2611 EXPECT_EQ("restricted", value); | 2611 EXPECT_EQ("restricted", value); |
2612 } | 2612 } |
2613 #endif | 2613 #endif |
2614 | 2614 |
2615 } // namespace policy | 2615 } // namespace policy |
OLD | NEW |