| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
| 6 | 6 |
| 7 #import "base/scoped_nsobject.h" | 7 #import "base/scoped_nsobject.h" |
| 8 #import "chrome/browser/cocoa/about_window_controller.h" | 8 #import "chrome/browser/cocoa/about_window_controller.h" |
| 9 #include "chrome/browser/cocoa/browser_test_helper.h" | 9 #include "chrome/browser/cocoa/browser_test_helper.h" |
| 10 #include "chrome/browser/cocoa/cocoa_test_helper.h" | 10 #include "chrome/browser/cocoa/cocoa_test_helper.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 ASSERT_EQ([button target], about_window_controller_.get()); | 39 ASSERT_EQ([button target], about_window_controller_.get()); |
| 40 ASSERT_EQ([button action], @selector(updateNow:)); | 40 ASSERT_EQ([button action], @selector(updateNow:)); |
| 41 | 41 |
| 42 // Make sure the button is disabled once clicked | 42 // Make sure the button is disabled once clicked |
| 43 [about_window_controller_ updateNow:about_window_controller_.get()]; | 43 [about_window_controller_ updateNow:about_window_controller_.get()]; |
| 44 ASSERT_FALSE([button isEnabled]); | 44 ASSERT_FALSE([button isEnabled]); |
| 45 } | 45 } |
| 46 | 46 |
| 47 // Doesn't confirm correctness, but does confirm something happens. | 47 // Doesn't confirm correctness, but does confirm something happens. |
| 48 TEST_F(AboutWindowControllerTest, TestCallbacks) { | 48 TEST_F(AboutWindowControllerTest, TestCallbacks) { |
| 49 NSString *upToDate = [[about_window_controller_ upToDateTextField] | 49 NSString *lastText = [[about_window_controller_ updateText] |
| 50 stringValue]; | 50 stringValue]; |
| 51 [about_window_controller_ upToDateCheckCompleted:NO latestVersion:@"foo"]; | 51 [about_window_controller_ upToDateCheckCompleted:NO latestVersion:@"foo"]; |
| 52 ASSERT_FALSE([upToDate isEqual:[[about_window_controller_ upToDateTextField] | 52 ASSERT_FALSE([lastText isEqual:[[about_window_controller_ updateText] |
| 53 stringValue]]); | 53 stringValue]]); |
| 54 | 54 |
| 55 NSString *completed = [[about_window_controller_ updateCompletedTextField] | 55 lastText = [[about_window_controller_ updateText] stringValue]; |
| 56 stringValue]; | |
| 57 [about_window_controller_ updateCompleted:NO installs:0]; | 56 [about_window_controller_ updateCompleted:NO installs:0]; |
| 58 ASSERT_FALSE([completed isEqual:[[about_window_controller_ | 57 ASSERT_FALSE([lastText isEqual:[[about_window_controller_ |
| 59 updateCompletedTextField] stringValue]]); | 58 updateText] stringValue]]); |
| 60 } | 59 } |
| 61 | 60 |
| 62 } // namespace | 61 } // namespace |
| 63 | 62 |
| OLD | NEW |