Revert of Add button to add new FSP services to Files app. (patchset #8 id:140001...
[chromium-blink-merge.git] / chrome / browser / ui / views / bookmarks / bookmark_sync_promo_view_unittest.cc
blob4d08179be23b11c76c407b7eef211394a2bfc586
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.
5 #include "chrome/browser/ui/views/bookmarks/bookmark_sync_promo_view.h"
7 #include "base/basictypes.h"
8 #include "base/compiler_specific.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "chrome/browser/ui/bookmarks/bookmark_bubble_delegate.h"
11 #include "testing/gtest/include/gtest/gtest.h"
12 #include "ui/events/event_constants.h"
13 #include "ui/gfx/range/range.h"
15 class BookmarkSyncPromoViewTest : public BookmarkBubbleDelegate,
16 public testing::Test {
17 public:
18 BookmarkSyncPromoViewTest() : sign_in_clicked_count_(0) {}
20 protected:
21 // BookmarkBubbleDelegate:
22 void OnSignInLinkClicked() override { ++sign_in_clicked_count_; }
24 // Number of times that OnSignInLinkClicked has been called.
25 int sign_in_clicked_count_;
27 private:
28 DISALLOW_COPY_AND_ASSIGN(BookmarkSyncPromoViewTest);
31 TEST_F(BookmarkSyncPromoViewTest, SignInLink) {
32 scoped_ptr<BookmarkSyncPromoView> sync_promo;
33 sync_promo.reset(new BookmarkSyncPromoView(this));
35 // Simulate clicking the "Sign in" link.
36 views::StyledLabelListener* listener = sync_promo.get();
37 listener->StyledLabelLinkClicked(gfx::Range(), ui::EF_NONE);
39 EXPECT_EQ(1, sign_in_clicked_count_);