| Index: chrome/browser/ui/views/bookmarks/bookmark_sync_promo_view_unittest.cc
|
| diff --git a/chrome/browser/ui/views/bookmarks/bookmark_sync_promo_view_unittest.cc b/chrome/browser/ui/views/bookmarks/bookmark_sync_promo_view_unittest.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..b8d55af80e775e8fcf2113ae62e8d45a215bfd09
|
| --- /dev/null
|
| +++ b/chrome/browser/ui/views/bookmarks/bookmark_sync_promo_view_unittest.cc
|
| @@ -0,0 +1,26 @@
|
| +// Copyright 2013 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "chrome/browser/ui/views/bookmarks/bookmark_sync_promo_view.h"
|
| +
|
| +#include "chrome/browser/ui/browser.h"
|
| +#include "chrome/browser/ui/tabs/tab_strip_model.h"
|
| +#include "chrome/test/base/browser_with_test_window_test.h"
|
| +#include "ui/base/events/event_constants.h"
|
| +#include "ui/base/range/range.h"
|
| +
|
| +typedef BrowserWithTestWindowTest BookmarkSyncPromoViewTest;
|
| +
|
| +TEST_F(BookmarkSyncPromoViewTest, SignInLink) {
|
| + int starting_tab_count = browser()->tab_strip_model()->count();
|
| + BookmarkSyncPromoView* view = new BookmarkSyncPromoView(browser());
|
| +
|
| + // Simulate clicking the "Sign in" link.
|
| + views::StyledLabelListener* listener = view;
|
| + listener->StyledLabelLinkClicked(ui::Range(), ui::EF_NONE);
|
| +
|
| + // A new tab should have been opened.
|
| + int tab_count = browser()->tab_strip_model()->count();
|
| + EXPECT_EQ(starting_tab_count + 1, tab_count);
|
| +}
|
|
|