| OLD | NEW |
| 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/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
| 10 #include "chrome/browser/google_apis/auth_service.h" | 10 #include "chrome/browser/google_apis/auth_service.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 : ui_thread_(content::BrowserThread::UI, &message_loop_), | 54 : ui_thread_(content::BrowserThread::UI, &message_loop_), |
| 55 file_thread_(content::BrowserThread::FILE), | 55 file_thread_(content::BrowserThread::FILE), |
| 56 io_thread_(content::BrowserThread::IO) { | 56 io_thread_(content::BrowserThread::IO) { |
| 57 } | 57 } |
| 58 | 58 |
| 59 virtual void SetUp() OVERRIDE { | 59 virtual void SetUp() OVERRIDE { |
| 60 file_thread_.Start(); | 60 file_thread_.Start(); |
| 61 io_thread_.StartIOThread(); | 61 io_thread_.StartIOThread(); |
| 62 profile_.reset(new TestingProfile); | 62 profile_.reset(new TestingProfile); |
| 63 | 63 |
| 64 service_.reset(new GDataWapiService); | 64 service_.reset(new GDataWapiService( |
| 65 GURL(GDataWapiUrlGenerator::kBaseUrlForProduction))); |
| 65 service_->Initialize(profile_.get()); | 66 service_->Initialize(profile_.get()); |
| 66 service_->auth_service_for_testing()->set_access_token_for_testing( | 67 service_->auth_service_for_testing()->set_access_token_for_testing( |
| 67 kTestGDataAuthToken); | 68 kTestGDataAuthToken); |
| 68 | 69 |
| 69 // Set a context getter in |g_browser_process|. This is required to be able | 70 // Set a context getter in |g_browser_process|. This is required to be able |
| 70 // to use net::URLFetcher. | 71 // to use net::URLFetcher. |
| 71 request_context_getter_.reset( | 72 request_context_getter_.reset( |
| 72 new ScopedRequestContextGetterForTesting( | 73 new ScopedRequestContextGetterForTesting( |
| 73 static_cast<TestingBrowserProcess*>(g_browser_process))); | 74 static_cast<TestingBrowserProcess*>(g_browser_process))); |
| 74 | 75 |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 false, // shared with me | 202 false, // shared with me |
| 202 std::string(), // directory resource ID | 203 std::string(), // directory resource ID |
| 203 base::Bind(&TestGetDocumentsCallback, &result, &result_data)); | 204 base::Bind(&TestGetDocumentsCallback, &result, &result_data)); |
| 204 MessageLoop::current()->Run(); | 205 MessageLoop::current()->Run(); |
| 205 | 206 |
| 206 EXPECT_EQ(GDATA_PARSE_ERROR, result); | 207 EXPECT_EQ(GDATA_PARSE_ERROR, result); |
| 207 EXPECT_FALSE(result_data); | 208 EXPECT_FALSE(result_data); |
| 208 } | 209 } |
| 209 | 210 |
| 210 } // namespace google_apis | 211 } // namespace google_apis |
| OLD | NEW |