OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // TODO(rickcam): Bug 73183: Add unit tests for image loading | 5 // TODO(rickcam): Bug 73183: Add unit tests for image loading |
6 | 6 |
7 #include <cstdlib> | 7 #include <cstdlib> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "chrome/browser/background_application_list_model.h" | 10 #include "chrome/browser/background_application_list_model.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 profile_.reset(NULL); | 61 profile_.reset(NULL); |
62 MessageLoop::current()->RunAllPending(); | 62 MessageLoop::current()->RunAllPending(); |
63 } | 63 } |
64 | 64 |
65 // This is modeled on a similar routine in ExtensionServiceTestBase. | 65 // This is modeled on a similar routine in ExtensionServiceTestBase. |
66 void BackgroundApplicationListModelTest::InitializeEmptyExtensionService() { | 66 void BackgroundApplicationListModelTest::InitializeEmptyExtensionService() { |
67 TestingProfile* profile = new TestingProfile(); | 67 TestingProfile* profile = new TestingProfile(); |
68 profile_.reset(profile); | 68 profile_.reset(profile); |
69 service_ = profile->CreateExtensionService( | 69 service_ = profile->CreateExtensionService( |
70 CommandLine::ForCurrentProcess(), | 70 CommandLine::ForCurrentProcess(), |
71 bogus_file_path()); | 71 bogus_file_path(), false); |
72 service_->set_extensions_enabled(true); | 72 service_->set_extensions_enabled(true); |
73 service_->set_show_extensions_prompts(false); | 73 service_->set_show_extensions_prompts(false); |
74 service_->OnLoadedInstalledExtensions(); /* Sends EXTENSIONS_READY */ | 74 service_->OnLoadedInstalledExtensions(); /* Sends EXTENSIONS_READY */ |
75 } | 75 } |
76 | 76 |
77 // Returns a barebones test Extension object with the specified |name|. The | 77 // Returns a barebones test Extension object with the specified |name|. The |
78 // returned extension will include background permission iff | 78 // returned extension will include background permission iff |
79 // |background_permission| is true. | 79 // |background_permission| is true. |
80 static scoped_refptr<Extension> CreateExtension(const std::string& name, | 80 static scoped_refptr<Extension> CreateExtension(const std::string& name, |
81 bool background_permission) { | 81 bool background_permission) { |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 extensions.erase(cursor); | 232 extensions.erase(cursor); |
233 --count; | 233 --count; |
234 ASSERT_EQ(count, extensions.size()); | 234 ASSERT_EQ(count, extensions.size()); |
235 service->UninstallExtension(extension->id(), false, NULL); | 235 service->UninstallExtension(extension->id(), false, NULL); |
236 ASSERT_EQ(count, service->extensions()->size()); | 236 ASSERT_EQ(count, service->extensions()->size()); |
237 ASSERT_EQ(expected, model->size()); | 237 ASSERT_EQ(expected, model->size()); |
238 } | 238 } |
239 } | 239 } |
240 } | 240 } |
241 } | 241 } |
OLD | NEW |