| 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 // MediaGalleriesPreferences unit tests. | 5 // MediaGalleriesPreferences unit tests. |
| 6 | 6 |
| 7 #include "chrome/browser/media_gallery/media_galleries_preferences.h" | 7 #include "chrome/browser/media_gallery/media_galleries_preferences.h" |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 extensions::Extension::NO_FLAGS, | 222 extensions::Extension::NO_FLAGS, |
| 223 &errors); | 223 &errors); |
| 224 EXPECT_TRUE(extension.get() != NULL) << errors; | 224 EXPECT_TRUE(extension.get() != NULL) << errors; |
| 225 EXPECT_TRUE(extensions::Extension::IdIsValid(extension->id())); | 225 EXPECT_TRUE(extensions::Extension::IdIsValid(extension->id())); |
| 226 if (!extension.get() || | 226 if (!extension.get() || |
| 227 !extensions::Extension::IdIsValid(extension->id())) { | 227 !extensions::Extension::IdIsValid(extension->id())) { |
| 228 return NULL; | 228 return NULL; |
| 229 } | 229 } |
| 230 | 230 |
| 231 extension_service_->extension_prefs()->OnExtensionInstalled( | 231 extension_service_->extension_prefs()->OnExtensionInstalled( |
| 232 extension, extensions::Extension::ENABLED, false, | 232 extension, extensions::Extension::ENABLED, |
| 233 syncer::StringOrdinal::CreateInitialOrdinal()); | 233 syncer::StringOrdinal::CreateInitialOrdinal()); |
| 234 | 234 |
| 235 return extension; | 235 return extension; |
| 236 } | 236 } |
| 237 | 237 |
| 238 // Needed for extension service & friends to work. | 238 // Needed for extension service & friends to work. |
| 239 MessageLoop loop_; | 239 MessageLoop loop_; |
| 240 content::TestBrowserThread ui_thread_; | 240 content::TestBrowserThread ui_thread_; |
| 241 content::TestBrowserThread file_thread_; | 241 content::TestBrowserThread file_thread_; |
| 242 | 242 |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 // Check that adding one of them again works as expected. | 569 // Check that adding one of them again works as expected. |
| 570 MediaGalleryPrefId id = gallery_prefs()->AddGallery( | 570 MediaGalleryPrefId id = gallery_prefs()->AddGallery( |
| 571 device_id, device_name, relative_path, true /*user*/); | 571 device_id, device_name, relative_path, true /*user*/); |
| 572 EXPECT_EQ(dev2_path2_id, id); | 572 EXPECT_EQ(dev2_path2_id, id); |
| 573 Verify(); | 573 Verify(); |
| 574 } | 574 } |
| 575 | 575 |
| 576 } // namespace | 576 } // namespace |
| 577 | 577 |
| 578 } // namespace chrome | 578 } // namespace chrome |
| OLD | NEW |