| 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/files/file_path.h" | 5 #include "base/files/file_path.h" |
| 6 #include "base/files/scoped_temp_dir.h" | 6 #include "base/files/scoped_temp_dir.h" |
| 7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "base/threading/sequenced_worker_pool.h" | 8 #include "base/threading/sequenced_worker_pool.h" |
| 9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
| 10 #include "chrome/browser/extensions/extension_browsertest.h" | 10 #include "chrome/browser/extensions/extension_browsertest.h" |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 net::URLFetcher::SetEnableInterceptionForTests(true); | 198 net::URLFetcher::SetEnableInterceptionForTests(true); |
| 199 interceptor.SetResponseIgnoreQuery( | 199 interceptor.SetResponseIgnoreQuery( |
| 200 GURL("http://localhost/autoupdate/updates.xml"), | 200 GURL("http://localhost/autoupdate/updates.xml"), |
| 201 test_data_dir_.AppendASCII("permissions_increase") | 201 test_data_dir_.AppendASCII("permissions_increase") |
| 202 .AppendASCII("updates.xml")); | 202 .AppendASCII("updates.xml")); |
| 203 interceptor.SetResponseIgnoreQuery( | 203 interceptor.SetResponseIgnoreQuery( |
| 204 GURL("http://localhost/autoupdate/v2.crx"), | 204 GURL("http://localhost/autoupdate/v2.crx"), |
| 205 scoped_temp_dir_.path().AppendASCII("permissions2.crx")); | 205 scoped_temp_dir_.path().AppendASCII("permissions2.crx")); |
| 206 | 206 |
| 207 extensions::ExtensionUpdater::CheckParams params; | 207 extensions::ExtensionUpdater::CheckParams params; |
| 208 params.check_blacklist = false; | |
| 209 service_->updater()->set_default_check_params(params); | 208 service_->updater()->set_default_check_params(params); |
| 210 | 209 |
| 211 // Sync is replacing an older version, so it pends. | 210 // Sync is replacing an older version, so it pends. |
| 212 EXPECT_FALSE(service_->ProcessExtensionSyncData(sync_data)); | 211 EXPECT_FALSE(service_->ProcessExtensionSyncData(sync_data)); |
| 213 | 212 |
| 214 WaitForExtensionInstall(); | 213 WaitForExtensionInstall(); |
| 215 content::BrowserThread::GetBlockingPool()->FlushForTesting(); | 214 content::BrowserThread::GetBlockingPool()->FlushForTesting(); |
| 216 base::RunLoop().RunUntilIdle(); | 215 base::RunLoop().RunUntilIdle(); |
| 217 | 216 |
| 218 extension = service_->GetExtensionById(extension_id, true); | 217 extension = service_->GetExtensionById(extension_id, true); |
| 219 ASSERT_TRUE(extension); | 218 ASSERT_TRUE(extension); |
| 220 EXPECT_EQ("2", extension->VersionString()); | 219 EXPECT_EQ("2", extension->VersionString()); |
| 221 EXPECT_EQ(1u, service_->disabled_extensions()->size()); | 220 EXPECT_EQ(1u, service_->disabled_extensions()->size()); |
| 222 EXPECT_EQ(Extension::DISABLE_PERMISSIONS_INCREASE, | 221 EXPECT_EQ(Extension::DISABLE_PERMISSIONS_INCREASE, |
| 223 service_->extension_prefs()->GetDisableReasons(extension_id)); | 222 service_->extension_prefs()->GetDisableReasons(extension_id)); |
| 224 EXPECT_TRUE(GetExtensionDisabledGlobalError()); | 223 EXPECT_TRUE(GetExtensionDisabledGlobalError()); |
| 225 } | 224 } |
| OLD | NEW |