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

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

Issue 10581012: Move test_url_fetcher_factory.* from content/ to net/url_request (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove export annotations Created 8 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/synchronization/waitable_event.h" 10 #include "base/synchronization/waitable_event.h"
11 #include "chrome/browser/extensions/app_notify_channel_setup.h" 11 #include "chrome/browser/extensions/app_notify_channel_setup.h"
12 #include "chrome/browser/extensions/app_notify_channel_ui.h" 12 #include "chrome/browser/extensions/app_notify_channel_ui.h"
13 #include "chrome/browser/signin/token_service_factory.h" 13 #include "chrome/browser/signin/token_service_factory.h"
14 #include "chrome/browser/signin/token_service_unittest.h" 14 #include "chrome/browser/signin/token_service_unittest.h"
15 #include "chrome/common/chrome_switches.h" 15 #include "chrome/common/chrome_switches.h"
16 #include "chrome/common/net/gaia/gaia_urls.h" 16 #include "chrome/common/net/gaia/gaia_urls.h"
17 #include "chrome/common/pref_names.h" 17 #include "chrome/common/pref_names.h"
18 #include "chrome/test/base/testing_pref_service.h" 18 #include "chrome/test/base/testing_pref_service.h"
19 #include "chrome/test/base/testing_profile.h" 19 #include "chrome/test/base/testing_profile.h"
20 #include "content/public/test/test_browser_thread.h" 20 #include "content/public/test/test_browser_thread.h"
21 #include "content/public/test/test_url_fetcher_factory.h"
22 #include "googleurl/src/gurl.h" 21 #include "googleurl/src/gurl.h"
22 #include "net/url_request/test_url_fetcher_factory.h"
23 #include "testing/gmock/include/gmock/gmock.h" 23 #include "testing/gmock/include/gmock/gmock.h"
24 #include "testing/gtest/include/gtest/gtest.h" 24 #include "testing/gtest/include/gtest/gtest.h"
25 25
26 using content::BrowserThread; 26 using content::BrowserThread;
27 using testing::_; 27 using testing::_;
28 using testing::Return; 28 using testing::Return;
29 29
30 namespace { 30 namespace {
31 31
32 const int kRouteId = 4; 32 const int kRouteId = 4;
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 db_thread_.Stop(); 249 db_thread_.Stop();
250 } 250 }
251 251
252 protected: 252 protected:
253 MessageLoop message_loop_; 253 MessageLoop message_loop_;
254 content::TestBrowserThread ui_thread_; 254 content::TestBrowserThread ui_thread_;
255 content::TestBrowserThread db_thread_; 255 content::TestBrowserThread db_thread_;
256 TestProfile profile_; 256 TestProfile profile_;
257 TestDelegate delegate_; 257 TestDelegate delegate_;
258 scoped_ptr<TestUI> ui_; 258 scoped_ptr<TestUI> ui_;
259 FakeURLFetcherFactory factory_; 259 net::FakeURLFetcherFactory factory_;
260 }; 260 };
261 261
262 TEST_F(AppNotifyChannelSetupTest, LoginFailure) { 262 TEST_F(AppNotifyChannelSetupTest, LoginFailure) {
263 SetupLogin(true, false); 263 SetupLogin(true, false);
264 264
265 scoped_refptr<AppNotifyChannelSetup> setup = CreateInstance(); 265 scoped_refptr<AppNotifyChannelSetup> setup = CreateInstance();
266 RunServerTest(setup, "", "canceled_by_user"); 266 RunServerTest(setup, "", "canceled_by_user");
267 } 267 }
268 268
269 TEST_F(AppNotifyChannelSetupTest, DoubleFetchAccessTokenFailure) { 269 TEST_F(AppNotifyChannelSetupTest, DoubleFetchAccessTokenFailure) {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 SetupLogin(false, true); 309 SetupLogin(false, true);
310 SetupFetchAccessToken(false); 310 SetupFetchAccessToken(false);
311 SetupLogin(true, true); 311 SetupLogin(true, true);
312 SetupFetchAccessToken(true); 312 SetupFetchAccessToken(true);
313 SetupRecordGrant(true); 313 SetupRecordGrant(true);
314 SetupGetChannelId(true); 314 SetupGetChannelId(true);
315 315
316 scoped_refptr<AppNotifyChannelSetup> setup = CreateInstance(); 316 scoped_refptr<AppNotifyChannelSetup> setup = CreateInstance();
317 RunServerTest(setup, "dummy_do_not_use", ""); 317 RunServerTest(setup, "dummy_do_not_use", "");
318 } 318 }
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/mock_url_fetchers.cc ('k') | chrome/browser/extensions/updater/extension_updater_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698