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/chromeos/gdata/gdata_documents_service.h" | 10 #include "chrome/browser/chromeos/gdata/gdata_documents_service.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 GDataTest() | 22 GDataTest() |
23 : InProcessBrowserTest(), | 23 : InProcessBrowserTest(), |
24 gdata_test_server_(net::TestServer::TYPE_GDATA, | 24 gdata_test_server_(net::TestServer::TYPE_GDATA, |
25 net::TestServer::kLocalhost, | 25 net::TestServer::kLocalhost, |
26 FilePath(FILE_PATH_LITERAL("chrome/test/data"))) { | 26 FilePath(FILE_PATH_LITERAL("chrome/test/data"))) { |
27 } | 27 } |
28 | 28 |
29 virtual void SetUpOnMainThread() OVERRIDE { | 29 virtual void SetUpOnMainThread() OVERRIDE { |
30 ASSERT_TRUE(gdata_test_server_.Start()); | 30 ASSERT_TRUE(gdata_test_server_.Start()); |
31 service_.reset(new gdata::DocumentsService); | 31 service_.reset(new gdata::DocumentsService); |
32 service_->Initialize(browser()->profile()); | 32 service_->Initialize(browser()->profile(), false); |
33 service_->auth_service_for_testing()->set_oauth2_auth_token_for_testing( | 33 service_->auth_service_for_testing()->set_oauth2_auth_token_for_testing( |
34 net::TestServer::kGDataAuthToken); | 34 net::TestServer::kGDataAuthToken); |
35 } | 35 } |
36 | 36 |
37 virtual void CleanUpOnMainThread() { | 37 virtual void CleanUpOnMainThread() { |
38 service_.reset(); | 38 service_.reset(); |
39 } | 39 } |
40 | 40 |
41 protected: | 41 protected: |
42 FilePath GetTestCachedFilePath(const FilePath& file_name) { | 42 FilePath GetTestCachedFilePath(const FilePath& file_name) { |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 gdata::DocumentsServiceInterface::GetDocumentsOptions( | 139 gdata::DocumentsServiceInterface::GetDocumentsOptions( |
140 0, // start_changestamp | 140 0, // start_changestamp |
141 std::string(), // search string | 141 std::string(), // search string |
142 std::string()), // directory resource ID | 142 std::string()), // directory resource ID |
143 base::Bind(&TestGetDocumentsCallback, &result, &result_data)); | 143 base::Bind(&TestGetDocumentsCallback, &result, &result_data)); |
144 ui_test_utils::RunMessageLoop(); | 144 ui_test_utils::RunMessageLoop(); |
145 | 145 |
146 EXPECT_EQ(gdata::GDATA_PARSE_ERROR, result); | 146 EXPECT_EQ(gdata::GDATA_PARSE_ERROR, result); |
147 EXPECT_FALSE(result_data); | 147 EXPECT_FALSE(result_data); |
148 } | 148 } |
OLD | NEW |