OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/compiler_specific.h" | 5 #include "base/compiler_specific.h" |
6 #include "base/strings/string16.h" | 6 #include "base/strings/string16.h" |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/browser/ui/cocoa/cocoa_test_helper.h" | 8 #include "chrome/browser/ui/cocoa/cocoa_test_helper.h" |
9 #import "chrome/browser/ui/cocoa/confirm_bubble_cocoa.h" | 9 #import "chrome/browser/ui/cocoa/confirm_bubble_cocoa.h" |
10 #import "chrome/browser/ui/cocoa/confirm_bubble_controller.h" | 10 #import "chrome/browser/ui/cocoa/confirm_bubble_controller.h" |
11 #include "chrome/browser/ui/confirm_bubble_model.h" | 11 #include "chrome/browser/ui/confirm_bubble_model.h" |
12 #include "grit/theme_resources.h" | 12 #include "grit/theme_resources.h" |
13 #import "testing/gtest_mac.h" | 13 #import "testing/gtest_mac.h" |
14 #include "ui/base/resource/resource_bundle.h" | 14 #include "ui/base/resource/resource_bundle.h" |
15 #import "ui/gfx/point.h" | 15 #import "ui/gfx/geometry/point.h" |
16 | 16 |
17 namespace { | 17 namespace { |
18 | 18 |
19 // The model object used in this test. This model implements all methods and | 19 // The model object used in this test. This model implements all methods and |
20 // updates its status when ConfirmBubbleController calls its methods. | 20 // updates its status when ConfirmBubbleController calls its methods. |
21 class TestConfirmBubbleModel : public ConfirmBubbleModel { | 21 class TestConfirmBubbleModel : public ConfirmBubbleModel { |
22 public: | 22 public: |
23 TestConfirmBubbleModel(bool* model_deleted, | 23 TestConfirmBubbleModel(bool* model_deleted, |
24 bool* accept_clicked, | 24 bool* accept_clicked, |
25 bool* cancel_clicked, | 25 bool* cancel_clicked, |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 // Click its link and verify this view has been removed from the test window. | 184 // Click its link and verify this view has been removed from the test window. |
185 // Also verify TestConfirmBubbleModel::LinkClicked() has been called. | 185 // Also verify TestConfirmBubbleModel::LinkClicked() has been called. |
186 [bubble clickLink]; | 186 [bubble clickLink]; |
187 | 187 |
188 contains_bubble_view = [[view subviews] containsObject:bubble]; | 188 contains_bubble_view = [[view subviews] containsObject:bubble]; |
189 EXPECT_FALSE(contains_bubble_view); | 189 EXPECT_FALSE(contains_bubble_view); |
190 EXPECT_FALSE(accept_clicked()); | 190 EXPECT_FALSE(accept_clicked()); |
191 EXPECT_FALSE(cancel_clicked()); | 191 EXPECT_FALSE(cancel_clicked()); |
192 EXPECT_TRUE(link_clicked()); | 192 EXPECT_TRUE(link_clicked()); |
193 } | 193 } |
OLD | NEW |