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 "base/string_util.h" | 8 #import "base/string_util.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #import "chrome/app/chrome_dll_resource.h" // For translate menu command ids. | 10 #import "chrome/app/chrome_dll_resource.h" // For translate menu command ids. |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 | 74 |
75 public: | 75 public: |
76 // Each test gets a single Mock translate delegate for the lifetime of | 76 // Each test gets a single Mock translate delegate for the lifetime of |
77 // the test. | 77 // the test. |
78 virtual void SetUp() { | 78 virtual void SetUp() { |
79 CocoaTest::SetUp(); | 79 CocoaTest::SetUp(); |
80 tab_contents.reset( | 80 tab_contents.reset( |
81 new TabContents(browser_helper_.profile(), | 81 new TabContents(browser_helper_.profile(), |
82 NULL, | 82 NULL, |
83 MSG_ROUTING_NONE, | 83 MSG_ROUTING_NONE, |
| 84 NULL, |
84 NULL)); | 85 NULL)); |
85 CreateInfoBar(); | 86 CreateInfoBar(); |
86 } | 87 } |
87 | 88 |
88 void CreateInfoBar() { | 89 void CreateInfoBar() { |
89 CreateInfoBar(TranslateInfoBarDelegate::BEFORE_TRANSLATE); | 90 CreateInfoBar(TranslateInfoBarDelegate::BEFORE_TRANSLATE); |
90 } | 91 } |
91 | 92 |
92 void CreateInfoBar(TranslateInfoBarDelegate::Type type) { | 93 void CreateInfoBar(TranslateInfoBarDelegate::Type type) { |
93 TranslateErrors::Type error = TranslateErrors::NONE; | 94 TranslateErrors::Type error = TranslateErrors::NONE; |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 translate_prefs.IncrementTranslationDeniedCount("en"); | 245 translate_prefs.IncrementTranslationDeniedCount("en"); |
245 } | 246 } |
246 CreateInfoBar(TranslateInfoBarDelegate::BEFORE_TRANSLATE); | 247 CreateInfoBar(TranslateInfoBarDelegate::BEFORE_TRANSLATE); |
247 BeforeTranslateInfobarController* controller = | 248 BeforeTranslateInfobarController* controller = |
248 (BeforeTranslateInfobarController*)infobar_controller.get(); | 249 (BeforeTranslateInfobarController*)infobar_controller.get(); |
249 EXPECT_TRUE([[controller alwaysTranslateButton] superview] == nil); | 250 EXPECT_TRUE([[controller alwaysTranslateButton] superview] == nil); |
250 EXPECT_TRUE([[controller neverTranslateButton] superview] != nil); | 251 EXPECT_TRUE([[controller neverTranslateButton] superview] != nil); |
251 } | 252 } |
252 | 253 |
253 } // namespace | 254 } // namespace |
OLD | NEW |