OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h" | 5 #include "chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/browser/bookmarks/bookmark_model.h" | |
9 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 8 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
10 #include "chrome/browser/bookmarks/bookmark_stats.h" | 9 #include "chrome/browser/bookmarks/bookmark_stats.h" |
11 #include "chrome/browser/bookmarks/bookmark_test_helpers.h" | 10 #include "chrome/browser/bookmarks/bookmark_test_helpers.h" |
12 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
13 #include "chrome/test/base/browser_with_test_window_test.h" | 12 #include "chrome/test/base/browser_with_test_window_test.h" |
14 #include "chrome/test/base/testing_profile.h" | 13 #include "chrome/test/base/testing_profile.h" |
| 14 #include "components/bookmarks/core/browser/bookmark_model.h" |
15 #include "ui/views/controls/menu/menu_runner.h" | 15 #include "ui/views/controls/menu/menu_runner.h" |
16 #include "ui/views/controls/menu/submenu_view.h" | 16 #include "ui/views/controls/menu/submenu_view.h" |
17 | 17 |
18 using base::ASCIIToUTF16; | 18 using base::ASCIIToUTF16; |
19 | 19 |
20 class BookmarkMenuDelegateTest : public BrowserWithTestWindowTest { | 20 class BookmarkMenuDelegateTest : public BrowserWithTestWindowTest { |
21 public: | 21 public: |
22 BookmarkMenuDelegateTest() : model_(NULL) {} | 22 BookmarkMenuDelegateTest() : model_(NULL) {} |
23 | 23 |
24 virtual void SetUp() OVERRIDE { | 24 virtual void SetUp() OVERRIDE { |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 EXPECT_EQ(1, root_item->GetSubmenu()->GetMenuItemCount()); | 218 EXPECT_EQ(1, root_item->GetSubmenu()->GetMenuItemCount()); |
219 EXPECT_EQ(1, root_item->GetSubmenu()->child_count()); // No separator. | 219 EXPECT_EQ(1, root_item->GetSubmenu()->child_count()); // No separator. |
220 | 220 |
221 // Verify correct handling of integer overflow with range, set kint32max as | 221 // Verify correct handling of integer overflow with range, set kint32max as |
222 // maximum and 1 less as minimum. Only "a" item should be created. | 222 // maximum and 1 less as minimum. Only "a" item should be created. |
223 NewAndInitDelegateForPermanent(kint32max - 1, kint32max); | 223 NewAndInitDelegateForPermanent(kint32max - 1, kint32max); |
224 root_item = bookmark_menu_delegate_->menu(); | 224 root_item = bookmark_menu_delegate_->menu(); |
225 EXPECT_EQ(1, root_item->GetSubmenu()->GetMenuItemCount()); | 225 EXPECT_EQ(1, root_item->GetSubmenu()->GetMenuItemCount()); |
226 EXPECT_EQ(1, root_item->GetSubmenu()->child_count()); // No separator. | 226 EXPECT_EQ(1, root_item->GetSubmenu()->child_count()); // No separator. |
227 } | 227 } |
OLD | NEW |