Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6922)

Unified Diff: chrome/browser/ui/views/bookmarks/bookmark_sync_promo_view_unittest.cc

Issue 18603006: Bookmark sync promo for Views. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: BookmarkBubbleView independant from browser, layout_constants and CAPS for enum Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
+}

Powered by Google App Engine
This is Rietveld 408576698