Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(299)

Side by Side Diff: chrome/browser/extensions/extension_disabled_ui_browsertest.cc

Issue 996213005: Don't crash when trying to create an ExtensionSyncData from invalid SyncData. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: kalmanize Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/threading/sequenced_worker_pool.h" 7 #include "base/threading/sequenced_worker_pool.h"
8 #include "chrome/app/chrome_command_ids.h" 8 #include "chrome/app/chrome_command_ids.h"
9 #include "chrome/browser/extensions/extension_browsertest.h" 9 #include "chrome/browser/extensions/extension_browsertest.h"
10 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 "http://localhost/autoupdate/updates.xml"); 231 "http://localhost/autoupdate/updates.xml");
232 specifics.mutable_extension()->set_version("2"); 232 specifics.mutable_extension()->set_version("2");
233 syncer::SyncData sync_data = 233 syncer::SyncData sync_data =
234 syncer::SyncData::CreateRemoteData(1234567, 234 syncer::SyncData::CreateRemoteData(1234567,
235 specifics, 235 specifics,
236 base::Time::Now(), 236 base::Time::Now(),
237 syncer::AttachmentIdList(), 237 syncer::AttachmentIdList(),
238 syncer::AttachmentServiceProxy()); 238 syncer::AttachmentServiceProxy());
239 // Sync is installing a new extension, so it pends. 239 // Sync is installing a new extension, so it pends.
240 EXPECT_FALSE(sync_service->ProcessExtensionSyncData( 240 EXPECT_FALSE(sync_service->ProcessExtensionSyncData(
241 extensions::ExtensionSyncData(sync_data))); 241 *extensions::ExtensionSyncData::CreateFromSyncData(sync_data)));
242 242
243 WaitForExtensionInstall(); 243 WaitForExtensionInstall();
244 content::RunAllBlockingPoolTasksUntilIdle(); 244 content::RunAllBlockingPoolTasksUntilIdle();
245 245
246 const Extension* extension = service_->GetExtensionById(extension_id, true); 246 const Extension* extension = service_->GetExtensionById(extension_id, true);
247 ASSERT_TRUE(extension); 247 ASSERT_TRUE(extension);
248 EXPECT_EQ("2", extension->VersionString()); 248 EXPECT_EQ("2", extension->VersionString());
249 EXPECT_EQ(1u, registry_->disabled_extensions().size()); 249 EXPECT_EQ(1u, registry_->disabled_extensions().size());
250 EXPECT_EQ(Extension::DISABLE_REMOTE_INSTALL, 250 EXPECT_EQ(Extension::DISABLE_REMOTE_INSTALL,
251 ExtensionPrefs::Get(service_->profile()) 251 ExtensionPrefs::Get(service_->profile())
252 ->GetDisableReasons(extension_id)); 252 ->GetDisableReasons(extension_id));
253 EXPECT_TRUE(GetExtensionDisabledGlobalError()); 253 EXPECT_TRUE(GetExtensionDisabledGlobalError());
254 } 254 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/app_sync_data_unittest.cc ('k') | chrome/browser/extensions/extension_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698