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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 #include "content/public/test/browser_test_utils.h" | 117 #include "content/public/test/browser_test_utils.h" |
118 #include "content/public/test/download_test_observer.h" | 118 #include "content/public/test/download_test_observer.h" |
119 #include "content/public/test/mock_notification_observer.h" | 119 #include "content/public/test/mock_notification_observer.h" |
120 #include "content/public/test/test_navigation_observer.h" | 120 #include "content/public/test/test_navigation_observer.h" |
121 #include "content/public/test/test_utils.h" | 121 #include "content/public/test/test_utils.h" |
122 #include "content/test/net/url_request_failed_job.h" | 122 #include "content/test/net/url_request_failed_job.h" |
123 #include "content/test/net/url_request_mock_http_job.h" | 123 #include "content/test/net/url_request_mock_http_job.h" |
124 #include "extensions/browser/extension_host.h" | 124 #include "extensions/browser/extension_host.h" |
125 #include "extensions/browser/extension_system.h" | 125 #include "extensions/browser/extension_system.h" |
126 #include "extensions/browser/process_manager.h" | 126 #include "extensions/browser/process_manager.h" |
| 127 #include "extensions/browser/uninstall_reason.h" |
127 #include "extensions/common/constants.h" | 128 #include "extensions/common/constants.h" |
128 #include "extensions/common/extension.h" | 129 #include "extensions/common/extension.h" |
129 #include "extensions/common/extension_set.h" | 130 #include "extensions/common/extension_set.h" |
130 #include "grit/generated_resources.h" | 131 #include "grit/generated_resources.h" |
131 #include "net/base/net_errors.h" | 132 #include "net/base/net_errors.h" |
132 #include "net/base/net_util.h" | 133 #include "net/base/net_util.h" |
133 #include "net/base/url_util.h" | 134 #include "net/base/url_util.h" |
134 #include "net/http/http_stream_factory.h" | 135 #include "net/http/http_stream_factory.h" |
135 #include "net/url_request/url_request.h" | 136 #include "net/url_request/url_request.h" |
136 #include "net/url_request/url_request_filter.h" | 137 #include "net/url_request/url_request_filter.h" |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 } | 702 } |
702 return NULL; | 703 return NULL; |
703 } | 704 } |
704 | 705 |
705 void UninstallExtension(const std::string& id, bool expect_success) { | 706 void UninstallExtension(const std::string& id, bool expect_success) { |
706 content::WindowedNotificationObserver observer( | 707 content::WindowedNotificationObserver observer( |
707 expect_success ? chrome::NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED | 708 expect_success ? chrome::NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED |
708 : chrome::NOTIFICATION_EXTENSION_UNINSTALL_NOT_ALLOWED, | 709 : chrome::NOTIFICATION_EXTENSION_UNINSTALL_NOT_ALLOWED, |
709 content::NotificationService::AllSources()); | 710 content::NotificationService::AllSources()); |
710 extension_service()->UninstallExtension( | 711 extension_service()->UninstallExtension( |
711 id, ExtensionService::UNINSTALL_REASON_FOR_TESTING, NULL); | 712 id, extensions::UNINSTALL_REASON_FOR_TESTING, NULL); |
712 observer.Wait(); | 713 observer.Wait(); |
713 } | 714 } |
714 | 715 |
715 void UpdateProviderPolicy(const PolicyMap& policy) { | 716 void UpdateProviderPolicy(const PolicyMap& policy) { |
716 provider_.UpdateChromePolicy(policy); | 717 provider_.UpdateChromePolicy(policy); |
717 DCHECK(base::MessageLoop::current()); | 718 DCHECK(base::MessageLoop::current()); |
718 base::RunLoop loop; | 719 base::RunLoop loop; |
719 loop.RunUntilIdle(); | 720 loop.RunUntilIdle(); |
720 } | 721 } |
721 | 722 |
(...skipping 2409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3131 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( | 3132 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( |
3132 browser2->tab_strip_model()->GetActiveWebContents(), | 3133 browser2->tab_strip_model()->GetActiveWebContents(), |
3133 "domAutomationController.send(window.showModalDialog !== undefined);", | 3134 "domAutomationController.send(window.showModalDialog !== undefined);", |
3134 &result)); | 3135 &result)); |
3135 EXPECT_TRUE(result); | 3136 EXPECT_TRUE(result); |
3136 } | 3137 } |
3137 | 3138 |
3138 #endif // !defined(CHROME_OS) | 3139 #endif // !defined(CHROME_OS) |
3139 | 3140 |
3140 } // namespace policy | 3141 } // namespace policy |
OLD | NEW |