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

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: Fix test for CrOS 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..34ee686043ad177aaf996a6ad469ec376e3943ca
--- /dev/null
+++ b/chrome/browser/ui/views/bookmarks/bookmark_sync_promo_view_unittest.cc
@@ -0,0 +1,42 @@
+// 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 "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "base/memory/scoped_ptr.h"
+#include "chrome/browser/ui/bookmarks/bookmark_bubble_delegate.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/base/events/event_constants.h"
+#include "ui/base/range/range.h"
+
+class BookmarkSyncPromoViewTest : public BookmarkBubbleDelegate,
+ public testing::Test {
+ public:
+ BookmarkSyncPromoViewTest() : sign_in_clicked_count_(0) {}
+
+ protected:
+ // BookmarkBubbleDelegate:
+ virtual void OnSignInLinkClicked() OVERRIDE {
+ ++sign_in_clicked_count_;
+ }
+
+ // Number of times that OnSignInLinkClicked has been called.
+ int sign_in_clicked_count_;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(BookmarkSyncPromoViewTest);
+};
+
+TEST_F(BookmarkSyncPromoViewTest, SignInLink) {
+ scoped_ptr<BookmarkSyncPromoView> sync_promo;
+ sync_promo.reset(new BookmarkSyncPromoView(this));
+
+ // Simulate clicking the "Sign in" link.
+ views::StyledLabelListener* listener = sync_promo.get();
+ listener->StyledLabelLinkClicked(ui::Range(), ui::EF_NONE);
+
+ EXPECT_EQ(1, sign_in_clicked_count_);
+}
« no previous file with comments | « chrome/browser/ui/views/bookmarks/bookmark_sync_promo_view.cc ('k') | chrome/browser/ui/views/browser_dialogs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698