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 "base/memory/ref_counted.h" | 5 #include "base/memory/ref_counted.h" |
6 #include "base/stl_util.h" | 6 #include "base/stl_util.h" |
7 #include "chrome/browser/extensions/autoupdate_interceptor.h" | 7 #include "chrome/browser/extensions/autoupdate_interceptor.h" |
8 #include "chrome/browser/extensions/extension_browsertest.h" | 8 #include "chrome/browser/extensions/extension_browsertest.h" |
9 #include "chrome/browser/extensions/extension_host.h" | 9 #include "chrome/browser/extensions/extension_host.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 // Did we see EXTENSION_UPDATING_STARTED? | 211 // Did we see EXTENSION_UPDATING_STARTED? |
212 bool started_; | 212 bool started_; |
213 | 213 |
214 // Did we see EXTENSION_UPDATING_FINISHED? | 214 // Did we see EXTENSION_UPDATING_FINISHED? |
215 bool finished_; | 215 bool finished_; |
216 | 216 |
217 // The set of extension id's we've seen via EXTENSION_UPDATE_FOUND. | 217 // The set of extension id's we've seen via EXTENSION_UPDATE_FOUND. |
218 std::set<std::string> updates_; | 218 std::set<std::string> updates_; |
219 }; | 219 }; |
220 | 220 |
| 221 #if defined(OS_WIN) |
| 222 // Fails consistently on Windows XP, see: http://crbug.com/120640. |
| 223 #define MAYBE_AutoUpdate DISABLED_AutoUpdate |
| 224 #else |
| 225 #define MAYBE_AutoUpdate AutoUpdate |
| 226 #endif |
| 227 |
221 // Tests extension autoupdate. | 228 // Tests extension autoupdate. |
222 IN_PROC_BROWSER_TEST_F(ExtensionManagementTest, AutoUpdate) { | 229 IN_PROC_BROWSER_TEST_F(ExtensionManagementTest, MAYBE_AutoUpdate) { |
223 NotificationListener notification_listener; | 230 NotificationListener notification_listener; |
224 FilePath basedir = test_data_dir_.AppendASCII("autoupdate"); | 231 FilePath basedir = test_data_dir_.AppendASCII("autoupdate"); |
225 // Note: This interceptor gets requests on the IO thread. | 232 // Note: This interceptor gets requests on the IO thread. |
226 scoped_refptr<AutoUpdateInterceptor> interceptor(new AutoUpdateInterceptor()); | 233 scoped_refptr<AutoUpdateInterceptor> interceptor(new AutoUpdateInterceptor()); |
227 content::URLFetcher::SetEnableInterceptionForTests(true); | 234 content::URLFetcher::SetEnableInterceptionForTests(true); |
228 | 235 |
229 interceptor->SetResponseOnIOThread("http://localhost/autoupdate/manifest", | 236 interceptor->SetResponseOnIOThread("http://localhost/autoupdate/manifest", |
230 basedir.AppendASCII("manifest_v2.xml")); | 237 basedir.AppendASCII("manifest_v2.xml")); |
231 interceptor->SetResponseOnIOThread("http://localhost/autoupdate/v2.crx", | 238 interceptor->SetResponseOnIOThread("http://localhost/autoupdate/v2.crx", |
232 basedir.AppendASCII("v2.crx")); | 239 basedir.AppendASCII("v2.crx")); |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 std::string(kExtensionId) + ";http://localhost/autoupdate/manifest")); | 527 std::string(kExtensionId) + ";http://localhost/autoupdate/manifest")); |
521 } | 528 } |
522 ASSERT_TRUE(WaitForExtensionInstall()); | 529 ASSERT_TRUE(WaitForExtensionInstall()); |
523 ASSERT_EQ(size_before + 1, service->extensions()->size()); | 530 ASSERT_EQ(size_before + 1, service->extensions()->size()); |
524 extension = service->GetExtensionById(kExtensionId, false); | 531 extension = service->GetExtensionById(kExtensionId, false); |
525 ASSERT_TRUE(extension); | 532 ASSERT_TRUE(extension); |
526 EXPECT_EQ(Extension::EXTERNAL_POLICY_DOWNLOAD, extension->location()); | 533 EXPECT_EQ(Extension::EXTERNAL_POLICY_DOWNLOAD, extension->location()); |
527 EXPECT_TRUE(service->IsExtensionEnabled(kExtensionId)); | 534 EXPECT_TRUE(service->IsExtensionEnabled(kExtensionId)); |
528 EXPECT_TRUE(service->disabled_extensions()->is_empty()); | 535 EXPECT_TRUE(service->disabled_extensions()->is_empty()); |
529 } | 536 } |
OLD | NEW |