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

Side by Side Diff: chrome/browser/signin/oauth2_token_service_unittest.cc

Issue 16290004: Update chrome/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 <string> 5 #include <string>
6 6
7 #include "base/stringprintf.h" 7 #include "base/stringprintf.h"
8 #include "chrome/browser/signin/oauth2_token_service.h" 8 #include "chrome/browser/signin/oauth2_token_service.h"
9 #include "chrome/browser/signin/oauth2_token_service_test_util.h" 9 #include "chrome/browser/signin/oauth2_token_service_test_util.h"
10 #include "chrome/browser/signin/token_service_factory.h" 10 #include "chrome/browser/signin/token_service_factory.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 public: 64 public:
65 OAuth2TokenServiceTest() 65 OAuth2TokenServiceTest()
66 : request_context_getter_(new net::TestURLRequestContextGetter( 66 : request_context_getter_(new net::TestURLRequestContextGetter(
67 message_loop_.message_loop_proxy())) { 67 message_loop_.message_loop_proxy())) {
68 } 68 }
69 69
70 virtual void SetUp() OVERRIDE { 70 virtual void SetUp() OVERRIDE {
71 TokenServiceTestHarness::SetUp(); 71 TokenServiceTestHarness::SetUp();
72 io_thread_.reset(new content::TestBrowserThread(content::BrowserThread::IO, 72 io_thread_.reset(new content::TestBrowserThread(content::BrowserThread::IO,
73 &message_loop_)); 73 &message_loop_));
74 oauth2_service_.reset(new TestOAuth2TokenService(request_context_getter_)); 74 oauth2_service_.reset(
75 new TestOAuth2TokenService(request_context_getter_.get()));
75 } 76 }
76 77
77 virtual void TearDown() OVERRIDE { 78 virtual void TearDown() OVERRIDE {
78 TokenServiceTestHarness::TearDown(); 79 TokenServiceTestHarness::TearDown();
79 } 80 }
80 81
81 protected: 82 protected:
82 scoped_ptr<content::TestBrowserThread> io_thread_; 83 scoped_ptr<content::TestBrowserThread> io_thread_;
83 scoped_refptr<net::TestURLRequestContextGetter> request_context_getter_; 84 scoped_refptr<net::TestURLRequestContextGetter> request_context_getter_;
84 net::TestURLFetcherFactory factory_; 85 net::TestURLFetcherFactory factory_;
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 EXPECT_EQ(1, consumer.number_of_errors_); 413 EXPECT_EQ(1, consumer.number_of_errors_);
413 414
414 fetcher = factory_.GetFetcherByID(0); 415 fetcher = factory_.GetFetcherByID(0);
415 EXPECT_TRUE(fetcher); 416 EXPECT_TRUE(fetcher);
416 fetcher->set_response_code(net::HTTP_UNAUTHORIZED); 417 fetcher->set_response_code(net::HTTP_UNAUTHORIZED);
417 fetcher->SetResponseString(std::string()); 418 fetcher->SetResponseString(std::string());
418 fetcher->delegate()->OnURLFetchComplete(fetcher); 419 fetcher->delegate()->OnURLFetchComplete(fetcher);
419 EXPECT_EQ(0, consumer.number_of_successful_tokens_); 420 EXPECT_EQ(0, consumer.number_of_successful_tokens_);
420 EXPECT_EQ(2, consumer.number_of_errors_); 421 EXPECT_EQ(2, consumer.number_of_errors_);
421 } 422 }
OLDNEW
« no previous file with comments | « chrome/browser/signin/oauth2_token_service.cc ('k') | chrome/browser/signin/signin_manager_cookie_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698