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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
145 #include "apps/shell_window_registry.h" | 145 #include "apps/shell_window_registry.h" |
146 #include "apps/ui/native_app_window.h" | 146 #include "apps/ui/native_app_window.h" |
147 #include "base/basictypes.h" | 147 #include "base/basictypes.h" |
148 #include "base/compiler_specific.h" | 148 #include "base/compiler_specific.h" |
149 #include "chrome/browser/ui/extensions/application_launch.h" | 149 #include "chrome/browser/ui/extensions/application_launch.h" |
150 #include "ui/base/window_open_disposition.h" | 150 #include "ui/base/window_open_disposition.h" |
151 #endif | 151 #endif |
152 | 152 |
153 using content::BrowserThread; | 153 using content::BrowserThread; |
154 using content::URLRequestMockHTTPJob; | 154 using content::URLRequestMockHTTPJob; |
155 using testing::AnyNumber; | 155 using testing::AnyNumber; |
bartfab (slow)
2013/11/05 15:53:04
Nit: No longer used.
Joao da Silva
2013/11/07 13:15:00
Done.
| |
156 using testing::Mock; | 156 using testing::Mock; |
157 using testing::Return; | 157 using testing::Return; |
158 using testing::_; | 158 using testing::_; |
159 | 159 |
160 namespace policy { | 160 namespace policy { |
161 | 161 |
162 namespace { | 162 namespace { |
163 | 163 |
164 #if defined(OS_CHROMEOS) | 164 #if defined(OS_CHROMEOS) |
165 const int kOneHourInMs = 60 * 60 * 1000; | 165 const int kOneHourInMs = 60 * 60 * 1000; |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
579 | 579 |
580 class PolicyTest : public InProcessBrowserTest { | 580 class PolicyTest : public InProcessBrowserTest { |
581 protected: | 581 protected: |
582 PolicyTest() {} | 582 PolicyTest() {} |
583 virtual ~PolicyTest() {} | 583 virtual ~PolicyTest() {} |
584 | 584 |
585 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 585 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
586 CommandLine::ForCurrentProcess()->AppendSwitch("noerrdialogs"); | 586 CommandLine::ForCurrentProcess()->AppendSwitch("noerrdialogs"); |
587 EXPECT_CALL(provider_, IsInitializationComplete(_)) | 587 EXPECT_CALL(provider_, IsInitializationComplete(_)) |
588 .WillRepeatedly(Return(true)); | 588 .WillRepeatedly(Return(true)); |
589 EXPECT_CALL(provider_, RegisterPolicyDomain(_)).Times(AnyNumber()); | |
590 BrowserPolicyConnector::SetPolicyProviderForTesting(&provider_); | 589 BrowserPolicyConnector::SetPolicyProviderForTesting(&provider_); |
591 } | 590 } |
592 | 591 |
593 virtual void SetUpOnMainThread() OVERRIDE { | 592 virtual void SetUpOnMainThread() OVERRIDE { |
594 BrowserThread::PostTask( | 593 BrowserThread::PostTask( |
595 BrowserThread::IO, FROM_HERE, | 594 BrowserThread::IO, FROM_HERE, |
596 base::Bind(chrome_browser_net::SetUrlRequestMocksEnabled, true)); | 595 base::Bind(chrome_browser_net::SetUrlRequestMocksEnabled, true)); |
597 } | 596 } |
598 | 597 |
599 // Makes URLRequestMockHTTPJobs serve data from content::DIR_TEST_DATA | 598 // Makes URLRequestMockHTTPJobs serve data from content::DIR_TEST_DATA |
(...skipping 2223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2823 chrome_variations::VariationsService::GetVariationsServerURL( | 2822 chrome_variations::VariationsService::GetVariationsServerURL( |
2824 g_browser_process->local_state()); | 2823 g_browser_process->local_state()); |
2825 EXPECT_TRUE(StartsWithASCII(url.spec(), default_variations_url, true)); | 2824 EXPECT_TRUE(StartsWithASCII(url.spec(), default_variations_url, true)); |
2826 std::string value; | 2825 std::string value; |
2827 EXPECT_TRUE(net::GetValueForKeyInQuery(url, "restrict", &value)); | 2826 EXPECT_TRUE(net::GetValueForKeyInQuery(url, "restrict", &value)); |
2828 EXPECT_EQ("restricted", value); | 2827 EXPECT_EQ("restricted", value); |
2829 } | 2828 } |
2830 #endif | 2829 #endif |
2831 | 2830 |
2832 } // namespace policy | 2831 } // namespace policy |
OLD | NEW |