Chromium Code Reviews| 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 1696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1707 UpdateProviderPolicy(policies); | 1707 UpdateProviderPolicy(policies); |
| 1708 EXPECT_TRUE(chrome::ExecuteCommand(browser(), IDC_HOME)); | 1708 EXPECT_TRUE(chrome::ExecuteCommand(browser(), IDC_HOME)); |
| 1709 content::WaitForLoadStop(contents); | 1709 content::WaitForLoadStop(contents); |
| 1710 EXPECT_EQ(GURL(chrome::kChromeUICreditsURL), contents->GetURL()); | 1710 EXPECT_EQ(GURL(chrome::kChromeUICreditsURL), contents->GetURL()); |
| 1711 | 1711 |
| 1712 policies.Set(key::kHomepageIsNewTabPage, POLICY_LEVEL_MANDATORY, | 1712 policies.Set(key::kHomepageIsNewTabPage, POLICY_LEVEL_MANDATORY, |
| 1713 POLICY_SCOPE_USER, base::Value::CreateBooleanValue(true), NULL); | 1713 POLICY_SCOPE_USER, base::Value::CreateBooleanValue(true), NULL); |
| 1714 UpdateProviderPolicy(policies); | 1714 UpdateProviderPolicy(policies); |
| 1715 EXPECT_TRUE(chrome::ExecuteCommand(browser(), IDC_HOME)); | 1715 EXPECT_TRUE(chrome::ExecuteCommand(browser(), IDC_HOME)); |
| 1716 content::WaitForLoadStop(contents); | 1716 content::WaitForLoadStop(contents); |
| 1717 EXPECT_TRUE(chrome::IsNTPURL(contents->GetURL(),browser()->profile())); | 1717 EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), contents->GetURL()); |
|
sky
2013/11/13 21:19:36
I'm pretty sure the failure for GURL comparisons i
samarth
2013/11/13 21:41:42
I was curious, so I just ran a unit test with:
G
| |
| 1718 } | 1718 } |
| 1719 | 1719 |
| 1720 IN_PROC_BROWSER_TEST_F(PolicyTest, IncognitoEnabled) { | 1720 IN_PROC_BROWSER_TEST_F(PolicyTest, IncognitoEnabled) { |
| 1721 // Verifies that incognito windows can't be opened when disabled by policy. | 1721 // Verifies that incognito windows can't be opened when disabled by policy. |
| 1722 | 1722 |
| 1723 const BrowserList* active_browser_list = | 1723 const BrowserList* active_browser_list = |
| 1724 BrowserList::GetInstance(chrome::GetActiveDesktop()); | 1724 BrowserList::GetInstance(chrome::GetActiveDesktop()); |
| 1725 | 1725 |
| 1726 // Disable incognito via policy and verify that incognito windows can't be | 1726 // Disable incognito via policy and verify that incognito windows can't be |
| 1727 // opened. | 1727 // opened. |
| (...skipping 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2834 chrome_variations::VariationsService::GetVariationsServerURL( | 2834 chrome_variations::VariationsService::GetVariationsServerURL( |
| 2835 g_browser_process->local_state()); | 2835 g_browser_process->local_state()); |
| 2836 EXPECT_TRUE(StartsWithASCII(url.spec(), default_variations_url, true)); | 2836 EXPECT_TRUE(StartsWithASCII(url.spec(), default_variations_url, true)); |
| 2837 std::string value; | 2837 std::string value; |
| 2838 EXPECT_TRUE(net::GetValueForKeyInQuery(url, "restrict", &value)); | 2838 EXPECT_TRUE(net::GetValueForKeyInQuery(url, "restrict", &value)); |
| 2839 EXPECT_EQ("restricted", value); | 2839 EXPECT_EQ("restricted", value); |
| 2840 } | 2840 } |
| 2841 #endif | 2841 #endif |
| 2842 | 2842 |
| 2843 } // namespace policy | 2843 } // namespace policy |
| OLD | NEW |