| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/ui/views/bookmarks/bookmark_sync_promo_view.h" |
| 6 |
| 7 #include "chrome/browser/ui/browser.h" |
| 8 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 9 #include "chrome/test/base/browser_with_test_window_test.h" |
| 10 #include "ui/base/events/event_constants.h" |
| 11 #include "ui/base/range/range.h" |
| 12 |
| 13 typedef BrowserWithTestWindowTest BookmarkSyncPromoViewTest; |
| 14 |
| 15 TEST_F(BookmarkSyncPromoViewTest, SignInLink) { |
| 16 int starting_tab_count = browser()->tab_strip_model()->count(); |
| 17 BookmarkSyncPromoView* view = new BookmarkSyncPromoView(browser()); |
| 18 |
| 19 // Simulate clicking the "Sign in" link. |
| 20 views::StyledLabelListener* listener = view; |
| 21 listener->StyledLabelLinkClicked(ui::Range(), ui::EF_NONE); |
| 22 |
| 23 // A new tab should have been opened. |
| 24 int tab_count = browser()->tab_strip_model()->count(); |
| 25 EXPECT_EQ(starting_tab_count + 1, tab_count); |
| 26 } |
| OLD | NEW |