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 30 matching lines...) Expand all Loading... |
41 : ui_thread_(content::BrowserThread::UI, &loop_), | 41 : ui_thread_(content::BrowserThread::UI, &loop_), |
42 file_thread_(content::BrowserThread::FILE, &loop_), | 42 file_thread_(content::BrowserThread::FILE, &loop_), |
43 profile_(new TestingProfile()), | 43 profile_(new TestingProfile()), |
44 extension_service_(NULL), | 44 extension_service_(NULL), |
45 default_galleries_count_(0) { | 45 default_galleries_count_(0) { |
46 } | 46 } |
47 | 47 |
48 virtual ~MediaGalleriesPreferencesTest() { | 48 virtual ~MediaGalleriesPreferencesTest() { |
49 // TestExtensionSystem uses DeleteSoon, so we need to delete the profile | 49 // TestExtensionSystem uses DeleteSoon, so we need to delete the profile |
50 // and then run the message queue to clean up. | 50 // and then run the message queue to clean up. |
| 51 MessageLoop::current()->RunAllPending(); |
51 profile_.reset(); | 52 profile_.reset(); |
52 MessageLoop::current()->RunAllPending(); | 53 MessageLoop::current()->RunAllPending(); |
53 } | 54 } |
54 | 55 |
55 virtual void SetUp() OVERRIDE { | 56 virtual void SetUp() OVERRIDE { |
56 CommandLine::ForCurrentProcess()->AppendSwitch( | 57 CommandLine::ForCurrentProcess()->AppendSwitch( |
57 switches::kEnableMediaGalleryUI); | 58 switches::kEnableMediaGalleryUI); |
58 extensions_dir_ = profile_->GetPath().AppendASCII("Extensions"); | 59 extensions_dir_ = profile_->GetPath().AppendASCII("Extensions"); |
59 ASSERT_TRUE(file_util::CreateDirectory(extensions_dir_)); | 60 ASSERT_TRUE(file_util::CreateDirectory(extensions_dir_)); |
60 | 61 |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 | 402 |
402 gallery_prefs()->SetGalleryPermissionForExtension( | 403 gallery_prefs()->SetGalleryPermissionForExtension( |
403 *regular_permission_extension.get(), user_added_id, false); | 404 *regular_permission_extension.get(), user_added_id, false); |
404 expected_galleries_for_regular.erase(user_added_id); | 405 expected_galleries_for_regular.erase(user_added_id); |
405 Verify(); | 406 Verify(); |
406 } | 407 } |
407 | 408 |
408 } // namespace | 409 } // namespace |
409 | 410 |
410 } // namespace chrome | 411 } // namespace chrome |
OLD | NEW |