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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 file_thread_(content::BrowserThread::FILE, &loop_), | 59 file_thread_(content::BrowserThread::FILE, &loop_), |
60 profile_(new TestingProfile()), | 60 profile_(new TestingProfile()), |
61 default_galleries_count_(0) { | 61 default_galleries_count_(0) { |
62 MediaStorageUtilTest::SetTestingMode(); | 62 MediaStorageUtilTest::SetTestingMode(); |
63 } | 63 } |
64 | 64 |
65 virtual ~MediaGalleriesPreferencesTest() { | 65 virtual ~MediaGalleriesPreferencesTest() { |
66 // TestExtensionSystem uses DeleteSoon, so we need to delete the profile | 66 // TestExtensionSystem uses DeleteSoon, so we need to delete the profile |
67 // and then run the message queue to clean up. | 67 // and then run the message queue to clean up. |
68 profile_.reset(); | 68 profile_.reset(); |
69 MessageLoop::current()->RunAllPending(); | 69 MessageLoop::current()->RunUntilIdle(); |
70 } | 70 } |
71 | 71 |
72 virtual void SetUp() OVERRIDE { | 72 virtual void SetUp() OVERRIDE { |
73 extensions::TestExtensionSystem* extension_system( | 73 extensions::TestExtensionSystem* extension_system( |
74 static_cast<extensions::TestExtensionSystem*>( | 74 static_cast<extensions::TestExtensionSystem*>( |
75 extensions::ExtensionSystem::Get(profile_.get()))); | 75 extensions::ExtensionSystem::Get(profile_.get()))); |
76 extension_system->CreateExtensionService( | 76 extension_system->CreateExtensionService( |
77 CommandLine::ForCurrentProcess(), FilePath(), false); | 77 CommandLine::ForCurrentProcess(), FilePath(), false); |
78 | 78 |
79 gallery_prefs_.reset(new MediaGalleriesPreferences(profile_.get())); | 79 gallery_prefs_.reset(new MediaGalleriesPreferences(profile_.get())); |
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 // Check that adding one of them again works as expected. | 555 // Check that adding one of them again works as expected. |
556 MediaGalleryPrefId id = gallery_prefs()->AddGallery( | 556 MediaGalleryPrefId id = gallery_prefs()->AddGallery( |
557 device_id, device_name, relative_path, true /*user*/); | 557 device_id, device_name, relative_path, true /*user*/); |
558 EXPECT_EQ(dev2_path2_id, id); | 558 EXPECT_EQ(dev2_path2_id, id); |
559 Verify(); | 559 Verify(); |
560 } | 560 } |
561 | 561 |
562 } // namespace | 562 } // namespace |
563 | 563 |
564 } // namespace chrome | 564 } // namespace chrome |
OLD | NEW |