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/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
8 #include "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 MenuItem::Id id(false, extension->id()); | 64 MenuItem::Id id(false, extension->id()); |
65 id.string_uid = string_id; | 65 id.string_uid = string_id; |
66 return new MenuItem(id, "test", false, true, type, contexts); | 66 return new MenuItem(id, "test", false, true, type, contexts); |
67 } | 67 } |
68 | 68 |
69 // Creates and returns a test Extension. The caller does *not* own the return | 69 // Creates and returns a test Extension. The caller does *not* own the return |
70 // value. | 70 // value. |
71 Extension* AddExtension(std::string name) { | 71 Extension* AddExtension(std::string name) { |
72 scoped_refptr<Extension> extension = prefs_.AddExtension(name); | 72 scoped_refptr<Extension> extension = prefs_.AddExtension(name); |
73 extensions_.push_back(extension); | 73 extensions_.push_back(extension); |
74 return extension; | 74 return extension.get(); |
75 } | 75 } |
76 | 76 |
77 protected: | 77 protected: |
78 TestingProfile profile_; | 78 TestingProfile profile_; |
79 MessageLoopForUI message_loop_; | 79 MessageLoopForUI message_loop_; |
80 content::TestBrowserThread ui_thread_; | 80 content::TestBrowserThread ui_thread_; |
81 content::TestBrowserThread file_thread_; | 81 content::TestBrowserThread file_thread_; |
82 | 82 |
83 MenuManager manager_; | 83 MenuManager manager_; |
84 ExtensionList extensions_; | 84 ExtensionList extensions_; |
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
699 ASSERT_TRUE(child1->checked()); | 699 ASSERT_TRUE(child1->checked()); |
700 | 700 |
701 // Removing |parent| should cause only |child1| to be selected. | 701 // Removing |parent| should cause only |child1| to be selected. |
702 manager_.RemoveContextMenuItem(parent->id()); | 702 manager_.RemoveContextMenuItem(parent->id()); |
703 parent = NULL; | 703 parent = NULL; |
704 ASSERT_FALSE(new_item->checked()); | 704 ASSERT_FALSE(new_item->checked()); |
705 ASSERT_TRUE(child1->checked()); | 705 ASSERT_TRUE(child1->checked()); |
706 } | 706 } |
707 | 707 |
708 } // namespace extensions | 708 } // namespace extensions |
OLD | NEW |