Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: chrome/browser/extensions/menu_manager_unittest.cc

Issue 108643002: ABANDONED: Remove Chrome dependencies from TestExtensionPrefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #include <vector> 5 #include <vector>
6 6
7 #include "base/files/scoped_temp_dir.h" 7 #include "base/files/scoped_temp_dir.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
9 #include "base/memory/scoped_vector.h" 9 #include "base/memory/scoped_vector.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 namespace context_menus = api::context_menus; 44 namespace context_menus = api::context_menus;
45 45
46 // Base class for tests. 46 // Base class for tests.
47 class MenuManagerTest : public testing::Test { 47 class MenuManagerTest : public testing::Test {
48 public: 48 public:
49 MenuManagerTest() 49 MenuManagerTest()
50 : ui_thread_(BrowserThread::UI, &message_loop_), 50 : ui_thread_(BrowserThread::UI, &message_loop_),
51 file_thread_(BrowserThread::FILE, &message_loop_), 51 file_thread_(BrowserThread::FILE, &message_loop_),
52 manager_(&profile_, ExtensionSystem::Get(&profile_)->state_store()), 52 manager_(&profile_, ExtensionSystem::Get(&profile_)->state_store()),
53 prefs_(message_loop_.message_loop_proxy().get()), 53 prefs_(message_loop_.message_loop_proxy().get(), NULL),
54 next_id_(1) {} 54 next_id_(1) {}
55 55
56 virtual void TearDown() OVERRIDE { 56 virtual void TearDown() OVERRIDE {
57 prefs_.pref_service()->CommitPendingWrite(); 57 prefs_.pref_service()->CommitPendingWrite();
58 message_loop_.RunUntilIdle(); 58 message_loop_.RunUntilIdle();
59 } 59 }
60 60
61 // Returns a test item. 61 // Returns a test item.
62 MenuItem* CreateTestItem(Extension* extension, bool incognito = false) { 62 MenuItem* CreateTestItem(Extension* extension, bool incognito = false) {
63 MenuItem::Type type = MenuItem::NORMAL; 63 MenuItem::Type type = MenuItem::NORMAL;
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after
751 EXPECT_EQ(4u, manager_.MenuItems(extension1->id())->size()); 751 EXPECT_EQ(4u, manager_.MenuItems(extension1->id())->size());
752 EXPECT_EQ(1u, manager_.MenuItems(extension2->id())->size()); 752 EXPECT_EQ(1u, manager_.MenuItems(extension2->id())->size());
753 753
754 // Remove all context menu items with incognito true. 754 // Remove all context menu items with incognito true.
755 manager_.RemoveAllIncognitoContextItems(); 755 manager_.RemoveAllIncognitoContextItems();
756 EXPECT_EQ(2u, manager_.MenuItems(extension1->id())->size()); 756 EXPECT_EQ(2u, manager_.MenuItems(extension1->id())->size());
757 EXPECT_EQ(1u, manager_.MenuItems(extension2->id())->size()); 757 EXPECT_EQ(1u, manager_.MenuItems(extension2->id())->size());
758 } 758 }
759 759
760 } // namespace extensions 760 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698