| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 #include "content/public/browser/notification_registrar.h" | 105 #include "content/public/browser/notification_registrar.h" |
| 106 #include "content/public/browser/notification_service.h" | 106 #include "content/public/browser/notification_service.h" |
| 107 #include "content/public/browser/notification_source.h" | 107 #include "content/public/browser/notification_source.h" |
| 108 #include "content/public/browser/notification_types.h" | 108 #include "content/public/browser/notification_types.h" |
| 109 #include "content/public/browser/plugin_service.h" | 109 #include "content/public/browser/plugin_service.h" |
| 110 #include "content/public/browser/render_process_host.h" | 110 #include "content/public/browser/render_process_host.h" |
| 111 #include "content/public/browser/render_view_host.h" | 111 #include "content/public/browser/render_view_host.h" |
| 112 #include "content/public/browser/web_contents.h" | 112 #include "content/public/browser/web_contents.h" |
| 113 #include "content/public/common/content_constants.h" | 113 #include "content/public/common/content_constants.h" |
| 114 #include "content/public/common/content_paths.h" | 114 #include "content/public/common/content_paths.h" |
| 115 #include "content/public/common/page_transition_types.h" | |
| 116 #include "content/public/common/process_type.h" | 115 #include "content/public/common/process_type.h" |
| 117 #include "content/public/common/result_codes.h" | 116 #include "content/public/common/result_codes.h" |
| 118 #include "content/public/common/url_constants.h" | 117 #include "content/public/common/url_constants.h" |
| 119 #include "content/public/common/webplugininfo.h" | 118 #include "content/public/common/webplugininfo.h" |
| 120 #include "content/public/test/browser_test_utils.h" | 119 #include "content/public/test/browser_test_utils.h" |
| 121 #include "content/public/test/download_test_observer.h" | 120 #include "content/public/test/download_test_observer.h" |
| 122 #include "content/public/test/mock_notification_observer.h" | 121 #include "content/public/test/mock_notification_observer.h" |
| 123 #include "content/public/test/test_navigation_observer.h" | 122 #include "content/public/test/test_navigation_observer.h" |
| 124 #include "content/public/test/test_utils.h" | 123 #include "content/public/test/test_utils.h" |
| 125 #include "extensions/browser/extension_host.h" | 124 #include "extensions/browser/extension_host.h" |
| 126 #include "extensions/browser/extension_system.h" | 125 #include "extensions/browser/extension_system.h" |
| 127 #include "extensions/browser/process_manager.h" | 126 #include "extensions/browser/process_manager.h" |
| 128 #include "extensions/browser/uninstall_reason.h" | 127 #include "extensions/browser/uninstall_reason.h" |
| 129 #include "extensions/common/constants.h" | 128 #include "extensions/common/constants.h" |
| 130 #include "extensions/common/extension.h" | 129 #include "extensions/common/extension.h" |
| 131 #include "extensions/common/extension_set.h" | 130 #include "extensions/common/extension_set.h" |
| 132 #include "net/base/net_errors.h" | 131 #include "net/base/net_errors.h" |
| 133 #include "net/base/net_util.h" | 132 #include "net/base/net_util.h" |
| 134 #include "net/base/url_util.h" | 133 #include "net/base/url_util.h" |
| 135 #include "net/http/http_stream_factory.h" | 134 #include "net/http/http_stream_factory.h" |
| 136 #include "net/test/url_request/url_request_failed_job.h" | 135 #include "net/test/url_request/url_request_failed_job.h" |
| 137 #include "net/test/url_request/url_request_mock_http_job.h" | 136 #include "net/test/url_request/url_request_mock_http_job.h" |
| 138 #include "net/url_request/url_request.h" | 137 #include "net/url_request/url_request.h" |
| 139 #include "net/url_request/url_request_filter.h" | 138 #include "net/url_request/url_request_filter.h" |
| 140 #include "policy/policy_constants.h" | 139 #include "policy/policy_constants.h" |
| 141 #include "testing/gmock/include/gmock/gmock.h" | 140 #include "testing/gmock/include/gmock/gmock.h" |
| 142 #include "testing/gtest/include/gtest/gtest.h" | 141 #include "testing/gtest/include/gtest/gtest.h" |
| 143 #include "third_party/WebKit/public/web/WebInputEvent.h" | 142 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 144 #include "ui/base/l10n/l10n_util.h" | 143 #include "ui/base/l10n/l10n_util.h" |
| 144 #include "ui/base/page_transition_types.h" |
| 145 #include "ui/base/resource/resource_bundle.h" | 145 #include "ui/base/resource/resource_bundle.h" |
| 146 #include "url/gurl.h" | 146 #include "url/gurl.h" |
| 147 | 147 |
| 148 #if defined(OS_CHROMEOS) | 148 #if defined(OS_CHROMEOS) |
| 149 #include "ash/accelerators/accelerator_controller.h" | 149 #include "ash/accelerators/accelerator_controller.h" |
| 150 #include "ash/accelerators/accelerator_table.h" | 150 #include "ash/accelerators/accelerator_table.h" |
| 151 #include "ash/magnifier/magnifier_constants.h" | 151 #include "ash/magnifier/magnifier_constants.h" |
| 152 #include "ash/shell.h" | 152 #include "ash/shell.h" |
| 153 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 153 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
| 154 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" | 154 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" |
| (...skipping 2642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2797 IN_PROC_BROWSER_TEST_P(RestoreOnStartupPolicyTest, PRE_RunTest) { | 2797 IN_PROC_BROWSER_TEST_P(RestoreOnStartupPolicyTest, PRE_RunTest) { |
| 2798 // Open some tabs to verify if they are restored after the browser restarts. | 2798 // Open some tabs to verify if they are restored after the browser restarts. |
| 2799 // Most policy settings override this, except kPrefValueLast which enforces | 2799 // Most policy settings override this, except kPrefValueLast which enforces |
| 2800 // a restore. | 2800 // a restore. |
| 2801 ui_test_utils::NavigateToURL(browser(), GURL(kRestoredURLs[0])); | 2801 ui_test_utils::NavigateToURL(browser(), GURL(kRestoredURLs[0])); |
| 2802 for (size_t i = 1; i < arraysize(kRestoredURLs); ++i) { | 2802 for (size_t i = 1; i < arraysize(kRestoredURLs); ++i) { |
| 2803 content::WindowedNotificationObserver observer( | 2803 content::WindowedNotificationObserver observer( |
| 2804 content::NOTIFICATION_LOAD_STOP, | 2804 content::NOTIFICATION_LOAD_STOP, |
| 2805 content::NotificationService::AllSources()); | 2805 content::NotificationService::AllSources()); |
| 2806 chrome::AddSelectedTabWithURL(browser(), GURL(kRestoredURLs[i]), | 2806 chrome::AddSelectedTabWithURL(browser(), GURL(kRestoredURLs[i]), |
| 2807 content::PAGE_TRANSITION_LINK); | 2807 ui::PAGE_TRANSITION_LINK); |
| 2808 observer.Wait(); | 2808 observer.Wait(); |
| 2809 } | 2809 } |
| 2810 } | 2810 } |
| 2811 | 2811 |
| 2812 IN_PROC_BROWSER_TEST_P(RestoreOnStartupPolicyTest, RunTest) { | 2812 IN_PROC_BROWSER_TEST_P(RestoreOnStartupPolicyTest, RunTest) { |
| 2813 #if defined(OS_WIN) && defined(USE_ASH) | 2813 #if defined(OS_WIN) && defined(USE_ASH) |
| 2814 // Disable this test in Metro+Ash for now (http://crbug.com/262796). | 2814 // Disable this test in Metro+Ash for now (http://crbug.com/262796). |
| 2815 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) | 2815 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) |
| 2816 return; | 2816 return; |
| 2817 #endif | 2817 #endif |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3226 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( | 3226 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( |
| 3227 browser2->tab_strip_model()->GetActiveWebContents(), | 3227 browser2->tab_strip_model()->GetActiveWebContents(), |
| 3228 "domAutomationController.send(window.showModalDialog !== undefined);", | 3228 "domAutomationController.send(window.showModalDialog !== undefined);", |
| 3229 &result)); | 3229 &result)); |
| 3230 EXPECT_TRUE(result); | 3230 EXPECT_TRUE(result); |
| 3231 } | 3231 } |
| 3232 | 3232 |
| 3233 #endif // !defined(CHROME_OS) | 3233 #endif // !defined(CHROME_OS) |
| 3234 | 3234 |
| 3235 } // namespace policy | 3235 } // namespace policy |
| OLD | NEW |