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

Side by Side Diff: chrome/browser/extensions/extension_webstore_private_browsertest.cc

Issue 7464009: Removal of Profile from content part 1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: works now Created 9 years, 5 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 #include "base/string_number_conversions.h" 5 #include "base/string_number_conversions.h"
6 #include "base/utf_string_conversions.h" 6 #include "base/utf_string_conversions.h"
7 #include "chrome/browser/browser_process.h" 7 #include "chrome/browser/browser_process.h"
8 #include "chrome/browser/browser_signin.h" 8 #include "chrome/browser/browser_signin.h"
9 #include "chrome/browser/extensions/extension_browsertest.h" 9 #include "chrome/browser/extensions/extension_browsertest.h"
10 #include "chrome/browser/extensions/extension_test_message_listener.h" 10 #include "chrome/browser/extensions/extension_test_message_listener.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 virtual void RequestSignin(TabContents* tab_contents, 79 virtual void RequestSignin(TabContents* tab_contents,
80 const string16& preferred_email, 80 const string16& preferred_email,
81 const string16& message, 81 const string16& message,
82 SigninDelegate* delegate) { 82 SigninDelegate* delegate) {
83 if (should_succeed_) { 83 if (should_succeed_) {
84 // Simulate valid login. 84 // Simulate valid login.
85 username_ = username_after_login_; 85 username_ = username_after_login_;
86 delegate->OnLoginSuccess(); 86 delegate->OnLoginSuccess();
87 87
88 // Fake a token available notification. 88 // Fake a token available notification.
89 Profile* profile = tab_contents->profile()->GetOriginalProfile(); 89 Profile* profile =
90 static_cast<Profile*>(tab_contents->context())->GetOriginalProfile();
90 TokenService* token_service = profile->GetTokenService(); 91 TokenService* token_service = profile->GetTokenService();
91 token_service->IssueAuthTokenForTest(GaiaConstants::kGaiaService, 92 token_service->IssueAuthTokenForTest(GaiaConstants::kGaiaService,
92 "new_token"); 93 "new_token");
93 } else { 94 } else {
94 delegate->OnLoginFailure(GoogleServiceAuthError( 95 delegate->OnLoginFailure(GoogleServiceAuthError(
95 GoogleServiceAuthError::REQUEST_CANCELED)); 96 GoogleServiceAuthError::REQUEST_CANCELED));
96 } 97 }
97 } 98 }
98 99
99 private: 100 private:
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 RunLoginTest("browser_login/expect_nonempty.html", 187 RunLoginTest("browser_login/expect_nonempty.html",
187 "foo@bar.com", false, ""); 188 "foo@bar.com", false, "");
188 189
189 RunLoginTest("browser_login/prompt_no_preferred.html", "", true, ""); 190 RunLoginTest("browser_login/prompt_no_preferred.html", "", true, "");
190 191
191 RunLoginTest("browser_login/prompt_preferred.html", "", true, "foo@bar.com"); 192 RunLoginTest("browser_login/prompt_preferred.html", "", true, "foo@bar.com");
192 193
193 RunLoginTest("browser_login/prompt_login_fails.html", 194 RunLoginTest("browser_login/prompt_login_fails.html",
194 "", false, "foo@bar.com"); 195 "", false, "foo@bar.com");
195 } 196 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698