| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 #include "chrome/browser/ui/browser_window.h" | 55 #include "chrome/browser/ui/browser_window.h" |
| 56 #include "chrome/browser/ui/host_desktop.h" | 56 #include "chrome/browser/ui/host_desktop.h" |
| 57 #include "chrome/browser/ui/omnibox/location_bar.h" | 57 #include "chrome/browser/ui/omnibox/location_bar.h" |
| 58 #include "chrome/browser/ui/omnibox/omnibox_edit_model.h" | 58 #include "chrome/browser/ui/omnibox/omnibox_edit_model.h" |
| 59 #include "chrome/browser/ui/omnibox/omnibox_view.h" | 59 #include "chrome/browser/ui/omnibox/omnibox_view.h" |
| 60 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 60 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 61 #include "chrome/common/chrome_notification_types.h" | 61 #include "chrome/common/chrome_notification_types.h" |
| 62 #include "chrome/common/chrome_paths.h" | 62 #include "chrome/common/chrome_paths.h" |
| 63 #include "chrome/common/chrome_switches.h" | 63 #include "chrome/common/chrome_switches.h" |
| 64 #include "chrome/common/content_settings.h" | 64 #include "chrome/common/content_settings.h" |
| 65 #include "chrome/common/extensions/api/requirements/requirements_handler.h" |
| 65 #include "chrome/common/extensions/extension.h" | 66 #include "chrome/common/extensions/extension.h" |
| 66 #include "chrome/common/extensions/extension_constants.h" | 67 #include "chrome/common/extensions/extension_constants.h" |
| 68 #include "chrome/common/extensions/manifest_handler.h" |
| 67 #include "chrome/common/pref_names.h" | 69 #include "chrome/common/pref_names.h" |
| 68 #include "chrome/common/url_constants.h" | 70 #include "chrome/common/url_constants.h" |
| 69 #include "chrome/test/base/in_process_browser_test.h" | 71 #include "chrome/test/base/in_process_browser_test.h" |
| 70 #include "chrome/test/base/ui_test_utils.h" | 72 #include "chrome/test/base/ui_test_utils.h" |
| 71 #include "content/public/browser/browser_child_process_host_iterator.h" | 73 #include "content/public/browser/browser_child_process_host_iterator.h" |
| 72 #include "content/public/browser/browser_context.h" | 74 #include "content/public/browser/browser_context.h" |
| 73 #include "content/public/browser/browser_thread.h" | 75 #include "content/public/browser/browser_thread.h" |
| 74 #include "content/public/browser/child_process_data.h" | 76 #include "content/public/browser/child_process_data.h" |
| 75 #include "content/public/browser/download_item.h" | 77 #include "content/public/browser/download_item.h" |
| 76 #include "content/public/browser/download_manager.h" | 78 #include "content/public/browser/download_manager.h" |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 virtual ~PolicyTest() {} | 426 virtual ~PolicyTest() {} |
| 425 | 427 |
| 426 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 428 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
| 427 EXPECT_CALL(provider_, IsInitializationComplete(_)) | 429 EXPECT_CALL(provider_, IsInitializationComplete(_)) |
| 428 .WillRepeatedly(Return(true)); | 430 .WillRepeatedly(Return(true)); |
| 429 EXPECT_CALL(provider_, RegisterPolicyDomain(_, _)).Times(AnyNumber()); | 431 EXPECT_CALL(provider_, RegisterPolicyDomain(_, _)).Times(AnyNumber()); |
| 430 BrowserPolicyConnector::SetPolicyProviderForTesting(&provider_); | 432 BrowserPolicyConnector::SetPolicyProviderForTesting(&provider_); |
| 431 } | 433 } |
| 432 | 434 |
| 433 virtual void SetUpOnMainThread() OVERRIDE { | 435 virtual void SetUpOnMainThread() OVERRIDE { |
| 436 InProcessBrowserTest::SetUpOnMainThread(); |
| 434 BrowserThread::PostTask( | 437 BrowserThread::PostTask( |
| 435 BrowserThread::IO, FROM_HERE, | 438 BrowserThread::IO, FROM_HERE, |
| 436 base::Bind(chrome_browser_net::SetUrlRequestMocksEnabled, true)); | 439 base::Bind(chrome_browser_net::SetUrlRequestMocksEnabled, true)); |
| 440 (new extensions::RequirementsHandler)->Register(); |
| 441 } |
| 442 |
| 443 virtual void CleanUpOnMainThread() OVERRIDE { |
| 444 extensions::ManifestHandler::ClearRegistryForTesting(); |
| 445 InProcessBrowserTest::CleanUpOnMainThread(); |
| 437 } | 446 } |
| 438 | 447 |
| 439 // Makes URLRequestMockHTTPJobs serve data from content::DIR_TEST_DATA | 448 // Makes URLRequestMockHTTPJobs serve data from content::DIR_TEST_DATA |
| 440 // instead of chrome::DIR_TEST_DATA. | 449 // instead of chrome::DIR_TEST_DATA. |
| 441 void ServeContentTestData() { | 450 void ServeContentTestData() { |
| 442 base::FilePath root_http; | 451 base::FilePath root_http; |
| 443 PathService::Get(content::DIR_TEST_DATA, &root_http); | 452 PathService::Get(content::DIR_TEST_DATA, &root_http); |
| 444 BrowserThread::PostTaskAndReply( | 453 BrowserThread::PostTaskAndReply( |
| 445 BrowserThread::IO, FROM_HERE, | 454 BrowserThread::IO, FROM_HERE, |
| 446 base::Bind(URLRequestMockHTTPJob::AddUrlHandler, root_http), | 455 base::Bind(URLRequestMockHTTPJob::AddUrlHandler, root_http), |
| (...skipping 1497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1944 this)); | 1953 this)); |
| 1945 | 1954 |
| 1946 MessageLoop::current()->Run(); | 1955 MessageLoop::current()->Run(); |
| 1947 } | 1956 } |
| 1948 | 1957 |
| 1949 INSTANTIATE_TEST_CASE_P(MediaStreamDevicesControllerBrowserTestInstance, | 1958 INSTANTIATE_TEST_CASE_P(MediaStreamDevicesControllerBrowserTestInstance, |
| 1950 MediaStreamDevicesControllerBrowserTest, | 1959 MediaStreamDevicesControllerBrowserTest, |
| 1951 testing::Bool()); | 1960 testing::Bool()); |
| 1952 | 1961 |
| 1953 } // namespace policy | 1962 } // namespace policy |
| OLD | NEW |