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 #include "base/scoped_nsobject.h" | 5 #include "base/scoped_nsobject.h" |
6 #include "base/scoped_ptr.h" | 6 #include "base/scoped_ptr.h" |
7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
8 #include "chrome/browser/cocoa/autocomplete_text_field.h" | 8 #include "chrome/browser/cocoa/autocomplete_text_field.h" |
9 #include "chrome/browser/cocoa/autocomplete_text_field_cell.h" | 9 #include "chrome/browser/cocoa/autocomplete_text_field_cell.h" |
10 #include "chrome/browser/cocoa/browser_test_helper.h" | 10 #include "chrome/browser/cocoa/browser_test_helper.h" |
11 #include "chrome/browser/cocoa/location_bar_view_mac.h" | 11 #include "chrome/browser/cocoa/location_bar_view_mac.h" |
12 #import "chrome/browser/cocoa/cocoa_test_helper.h" | 12 #import "chrome/browser/cocoa/cocoa_test_helper.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
14 | 14 |
15 // TODO(shess): Figure out how to unittest this. The code below was | 15 // TODO(shess): Figure out how to unittest this. The code below was |
16 // testing the hacked-up behavior so you didn't have to be pedantic | 16 // testing the hacked-up behavior so you didn't have to be pedantic |
17 // WRT http://. But that approach is completely and utterly wrong in | 17 // WRT http://. But that approach is completely and utterly wrong in |
18 // a world where omnibox is running. | 18 // a world where omnibox is running. |
19 // http://code.google.com/p/chromium/issues/detail?id=9977 | 19 // http://code.google.com/p/chromium/issues/detail?id=9977 |
20 | 20 |
21 #if 0 | 21 #if 0 |
22 class LocationBarViewMacTest : public testing::Test { | 22 class LocationBarViewMacTest : public testing::Test { |
23 public: | 23 public: |
24 LocationBarViewMacTest() | 24 LocationBarViewMacTest() |
25 : field_([[NSTextField alloc] init]), | 25 : field_([[NSTextField alloc] init]), |
26 locationBarView_(new LocationBarViewMac(field_, NULL, NULL)) { | 26 locationBarView_(new LocationBarViewMac(field_, NULL, NULL, NULL)) { |
27 } | 27 } |
28 | 28 |
29 scoped_nsobject<NSTextField> field_; | 29 scoped_nsobject<NSTextField> field_; |
30 scoped_ptr<LocationBarViewMac> locationBarView_; | 30 scoped_ptr<LocationBarViewMac> locationBarView_; |
31 }; | 31 }; |
32 | 32 |
33 TEST_F(LocationBarViewMacTest, GetInputString) { | 33 TEST_F(LocationBarViewMacTest, GetInputString) { |
34 // Test a few obvious cases to make sure things work end-to-end, but | 34 // Test a few obvious cases to make sure things work end-to-end, but |
35 // trust url_fixer_upper_unittest.cc to do the bulk of the work. | 35 // trust url_fixer_upper_unittest.cc to do the bulk of the work. |
36 [field_ setStringValue:@"ahost"]; | 36 [field_ setStringValue:@"ahost"]; |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 EXPECT_FALSE([cell hintString]); | 121 EXPECT_FALSE([cell hintString]); |
122 | 122 |
123 // Transition back to baseline. | 123 // Transition back to baseline. |
124 LocationBarViewMac::OnChangedImpl( | 124 LocationBarViewMac::OnChangedImpl( |
125 field_.get(), std::wstring(), std::wstring(), false, false, image); | 125 field_.get(), std::wstring(), std::wstring(), false, false, image); |
126 EXPECT_FALSE([cell keywordString]); | 126 EXPECT_FALSE([cell keywordString]); |
127 EXPECT_FALSE([cell hintString]); | 127 EXPECT_FALSE([cell hintString]); |
128 } | 128 } |
129 | 129 |
130 } // namespace | 130 } // namespace |
OLD | NEW |