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