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 #import "base/mac/scoped_nsobject.h" | 5 #import "base/mac/scoped_nsobject.h" |
6 #include "base/strings/string16.h" | 6 #include "base/strings/string16.h" |
7 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 7 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
9 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.h" | 9 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.h" |
10 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" | 10 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 - (void)openURLForNode:(const BookmarkNode*)node { | 49 - (void)openURLForNode:(const BookmarkNode*)node { |
50 std::string url = node->url().possibly_invalid_spec(); | 50 std::string url = node->url().possibly_invalid_spec(); |
51 if (url.find("http://0.com") != std::string::npos) | 51 if (url.find("http://0.com") != std::string::npos) |
52 opened_[0] = YES; | 52 opened_[0] = YES; |
53 if (url.find("http://1.com") != std::string::npos) | 53 if (url.find("http://1.com") != std::string::npos) |
54 opened_[1] = YES; | 54 opened_[1] = YES; |
55 } | 55 } |
56 | 56 |
57 - (void)openAll:(NSInteger)tag | 57 - (void)openAll:(NSInteger)tag |
58 withDisposition:(WindowOpenDisposition)disposition { | 58 withDisposition:(WindowOpenDisposition)disposition { |
59 if (disposition == NEW_FOREGROUND_TAB) { | 59 if (disposition == WindowOpenDisposition::NEW_FOREGROUND_TAB) { |
60 opened_new_foreground_tab = YES; | 60 opened_new_foreground_tab = YES; |
61 } else if (disposition == NEW_WINDOW) { | 61 } else if (disposition == WindowOpenDisposition::NEW_WINDOW) { |
62 opened_new_window = YES; | 62 opened_new_window = YES; |
63 } else if (disposition == OFF_THE_RECORD) { | 63 } else if (disposition == WindowOpenDisposition::OFF_THE_RECORD) { |
64 opened_off_the_record = YES; | 64 opened_off_the_record = YES; |
65 } | 65 } |
66 } | 66 } |
67 | 67 |
68 @end // FakeBookmarkMenuController | 68 @end // FakeBookmarkMenuController |
69 | 69 |
70 class BookmarkMenuCocoaControllerTest : public CocoaProfileTest { | 70 class BookmarkMenuCocoaControllerTest : public CocoaProfileTest { |
71 public: | 71 public: |
72 void SetUp() override { | 72 void SetUp() override { |
73 CocoaProfileTest::SetUp(); | 73 CocoaProfileTest::SetUp(); |
(...skipping 27 matching lines...) Expand all Loading... |
101 EXPECT_NE(c->opened_new_foreground_tab, NO); | 101 EXPECT_NE(c->opened_new_foreground_tab, NO); |
102 | 102 |
103 EXPECT_EQ(c->opened_new_window, NO); | 103 EXPECT_EQ(c->opened_new_window, NO); |
104 [c openAllBookmarksNewWindow:item]; | 104 [c openAllBookmarksNewWindow:item]; |
105 EXPECT_NE(c->opened_new_window, NO); | 105 EXPECT_NE(c->opened_new_window, NO); |
106 | 106 |
107 EXPECT_EQ(c->opened_off_the_record, NO); | 107 EXPECT_EQ(c->opened_off_the_record, NO); |
108 [c openAllBookmarksIncognitoWindow:item]; | 108 [c openAllBookmarksIncognitoWindow:item]; |
109 EXPECT_NE(c->opened_off_the_record, NO); | 109 EXPECT_NE(c->opened_off_the_record, NO); |
110 } | 110 } |
OLD | NEW |