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 #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.h" | 10 #include "base/message_loop.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 // Creates and returns a test Extension. The caller does *not* own the return | 77 // Creates and returns a test Extension. The caller does *not* own the return |
78 // value. | 78 // value. |
79 Extension* AddExtension(std::string name) { | 79 Extension* AddExtension(std::string name) { |
80 scoped_refptr<Extension> extension = prefs_.AddExtension(name); | 80 scoped_refptr<Extension> extension = prefs_.AddExtension(name); |
81 extensions_.push_back(extension); | 81 extensions_.push_back(extension); |
82 return extension; | 82 return extension; |
83 } | 83 } |
84 | 84 |
85 protected: | 85 protected: |
86 TestingProfile profile_; | 86 TestingProfile profile_; |
87 MessageLoopForUI message_loop_; | 87 base::MessageLoopForUI message_loop_; |
88 content::TestBrowserThread ui_thread_; | 88 content::TestBrowserThread ui_thread_; |
89 content::TestBrowserThread file_thread_; | 89 content::TestBrowserThread file_thread_; |
90 | 90 |
91 MenuManager manager_; | 91 MenuManager manager_; |
92 ExtensionList extensions_; | 92 ExtensionList extensions_; |
93 TestExtensionPrefs prefs_; | 93 TestExtensionPrefs prefs_; |
94 int next_id_; | 94 int next_id_; |
95 | 95 |
96 private: | 96 private: |
97 DISALLOW_COPY_AND_ASSIGN(MenuManagerTest); | 97 DISALLOW_COPY_AND_ASSIGN(MenuManagerTest); |
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
748 EXPECT_EQ(4u, manager_.MenuItems(extension1->id())->size()); | 748 EXPECT_EQ(4u, manager_.MenuItems(extension1->id())->size()); |
749 EXPECT_EQ(1u, manager_.MenuItems(extension2->id())->size()); | 749 EXPECT_EQ(1u, manager_.MenuItems(extension2->id())->size()); |
750 | 750 |
751 // Remove all context menu items with incognito true. | 751 // Remove all context menu items with incognito true. |
752 manager_.RemoveAllIncognitoContextItems(); | 752 manager_.RemoveAllIncognitoContextItems(); |
753 EXPECT_EQ(2u, manager_.MenuItems(extension1->id())->size()); | 753 EXPECT_EQ(2u, manager_.MenuItems(extension1->id())->size()); |
754 EXPECT_EQ(1u, manager_.MenuItems(extension2->id())->size()); | 754 EXPECT_EQ(1u, manager_.MenuItems(extension2->id())->size()); |
755 } | 755 } |
756 | 756 |
757 } // namespace extensions | 757 } // namespace extensions |
OLD | NEW |