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

Side by Side Diff: chrome/browser/ui/cocoa/infobars/translate_infobar_unittest.mm

Issue 229363002: Componentize TranslateUIDelegate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix mac Created 6 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/mac/scoped_nsobject.h" 7 #import "base/mac/scoped_nsobject.h"
8 #import "base/strings/string_util.h" 8 #import "base/strings/string_util.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #import "chrome/app/chrome_command_ids.h" // For translate menu command ids. 10 #import "chrome/app/chrome_command_ids.h" // For translate menu command ids.
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 } 70 }
71 71
72 // Each test gets a single Mock translate delegate for the lifetime of 72 // Each test gets a single Mock translate delegate for the lifetime of
73 // the test. 73 // the test.
74 virtual void SetUp() OVERRIDE { 74 virtual void SetUp() OVERRIDE {
75 TranslateLanguageList::DisableUpdate(); 75 TranslateLanguageList::DisableUpdate();
76 CocoaProfileTest::SetUp(); 76 CocoaProfileTest::SetUp();
77 web_contents_.reset( 77 web_contents_.reset(
78 WebContents::Create(WebContents::CreateParams(profile()))); 78 WebContents::Create(WebContents::CreateParams(profile())));
79 InfoBarService::CreateForWebContents(web_contents_.get()); 79 InfoBarService::CreateForWebContents(web_contents_.get());
80 TranslateTabHelper::CreateForWebContents(web_contents_.get());
80 } 81 }
81 82
82 virtual void TearDown() OVERRIDE { 83 virtual void TearDown() OVERRIDE {
83 if (infobar_) { 84 if (infobar_) {
84 infobar_->CloseSoon(); 85 infobar_->CloseSoon();
85 infobar_ = NULL; 86 infobar_ = NULL;
86 } 87 }
87 CocoaProfileTest::TearDown(); 88 CocoaProfileTest::TearDown();
88 } 89 }
89 90
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 translate_prefs->ResetTranslationDeniedCount("en"); 262 translate_prefs->ResetTranslationDeniedCount("en");
262 for (int i = 0; i < 4; ++i) { 263 for (int i = 0; i < 4; ++i) {
263 translate_prefs->IncrementTranslationDeniedCount("en"); 264 translate_prefs->IncrementTranslationDeniedCount("en");
264 } 265 }
265 CreateInfoBar(translate::TRANSLATE_STEP_BEFORE_TRANSLATE); 266 CreateInfoBar(translate::TRANSLATE_STEP_BEFORE_TRANSLATE);
266 BeforeTranslateInfobarController* controller = 267 BeforeTranslateInfobarController* controller =
267 (BeforeTranslateInfobarController*)infobar_controller_.get(); 268 (BeforeTranslateInfobarController*)infobar_controller_.get();
268 EXPECT_TRUE([[controller alwaysTranslateButton] superview] == nil); 269 EXPECT_TRUE([[controller alwaysTranslateButton] superview] == nil);
269 EXPECT_TRUE([[controller neverTranslateButton] superview] != nil); 270 EXPECT_TRUE([[controller neverTranslateButton] superview] != nil);
270 } 271 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller.mm ('k') | chrome/browser/ui/cocoa/translate/translate_bubble_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698