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

Side by Side 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 unified diff | Download patch
OLDNEW
(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 "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/base/events/event_constants.h"
13 #include "ui/base/range/range.h"
14
15 class BookmarkSyncPromoViewTest : public BookmarkBubbleDelegate,
16 public testing::Test {
17 public:
18 BookmarkSyncPromoViewTest() : sign_in_clicked_count_(0) {}
19
20 protected:
21 // BookmarkBubbleDelegate:
22 virtual void OnSignInLinkClicked() OVERRIDE {
23 ++sign_in_clicked_count_;
24 }
25
26 // Number of times that OnSignInLinkClicked has been called.
27 int sign_in_clicked_count_;
28
29 private:
30 DISALLOW_COPY_AND_ASSIGN(BookmarkSyncPromoViewTest);
31 };
32
33 TEST_F(BookmarkSyncPromoViewTest, SignInLink) {
34 scoped_ptr<BookmarkSyncPromoView> sync_promo;
35 sync_promo.reset(new BookmarkSyncPromoView(this));
36
37 // Simulate clicking the "Sign in" link.
38 views::StyledLabelListener* listener = sync_promo.get();
39 listener->StyledLabelLinkClicked(ui::Range(), ui::EF_NONE);
40
41 EXPECT_EQ(1, sign_in_clicked_count_);
42 }
OLDNEW
« 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