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(); | |
52 profile_.reset(); | 51 profile_.reset(); |
53 MessageLoop::current()->RunAllPending(); | 52 MessageLoop::current()->RunAllPending(); |
54 } | 53 } |
55 | 54 |
56 virtual void SetUp() OVERRIDE { | 55 virtual void SetUp() OVERRIDE { |
57 CommandLine::ForCurrentProcess()->AppendSwitch( | 56 CommandLine::ForCurrentProcess()->AppendSwitch( |
58 switches::kEnableMediaGalleryUI); | 57 switches::kEnableMediaGalleryUI); |
59 extensions_dir_ = profile_->GetPath().AppendASCII("Extensions"); | 58 extensions_dir_ = profile_->GetPath().AppendASCII("Extensions"); |
60 ASSERT_TRUE(file_util::CreateDirectory(extensions_dir_)); | 59 ASSERT_TRUE(file_util::CreateDirectory(extensions_dir_)); |
61 | 60 |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 | 401 |
403 gallery_prefs()->SetGalleryPermissionForExtension( | 402 gallery_prefs()->SetGalleryPermissionForExtension( |
404 *regular_permission_extension.get(), user_added_id, false); | 403 *regular_permission_extension.get(), user_added_id, false); |
405 expected_galleries_for_regular.erase(user_added_id); | 404 expected_galleries_for_regular.erase(user_added_id); |
406 Verify(); | 405 Verify(); |
407 } | 406 } |
408 | 407 |
409 } // namespace | 408 } // namespace |
410 | 409 |
411 } // namespace chrome | 410 } // namespace chrome |
OLD | NEW |