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 "webkit/fileapi/file_system_url_request_job.h" | 5 #include "webkit/fileapi/file_system_url_request_job.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 void FillBuffer(char* buffer, size_t len) { | 44 void FillBuffer(char* buffer, size_t len) { |
45 base::RandBytes(buffer, len); | 45 base::RandBytes(buffer, len); |
46 } | 46 } |
47 | 47 |
48 } // namespace | 48 } // namespace |
49 | 49 |
50 class FileSystemURLRequestJobTest : public testing::Test { | 50 class FileSystemURLRequestJobTest : public testing::Test { |
51 protected: | 51 protected: |
52 FileSystemURLRequestJobTest() | 52 FileSystemURLRequestJobTest() |
53 : message_loop_(MessageLoop::TYPE_IO), // simulate an IO thread | 53 : message_loop_(MessageLoop::TYPE_IO), // simulate an IO thread |
54 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { | 54 weak_factory_(this) { |
55 } | 55 } |
56 | 56 |
57 virtual void SetUp() OVERRIDE { | 57 virtual void SetUp() OVERRIDE { |
58 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 58 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
59 | 59 |
60 // We use the main thread so that we can get the root path synchronously. | 60 // We use the main thread so that we can get the root path synchronously. |
61 // TODO(adamk): Run this on the FILE thread we've created as well. | 61 // TODO(adamk): Run this on the FILE thread we've created as well. |
62 file_system_context_ = | 62 file_system_context_ = |
63 CreateFileSystemContextForTesting(NULL, temp_dir_.path()); | 63 CreateFileSystemContextForTesting(NULL, temp_dir_.path()); |
64 | 64 |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 | 350 |
351 TestRequest(CreateFileSystemURL(kFilename)); | 351 TestRequest(CreateFileSystemURL(kFilename)); |
352 | 352 |
353 std::string mime_type_from_job; | 353 std::string mime_type_from_job; |
354 request_->GetMimeType(&mime_type_from_job); | 354 request_->GetMimeType(&mime_type_from_job); |
355 EXPECT_EQ(mime_type_direct, mime_type_from_job); | 355 EXPECT_EQ(mime_type_direct, mime_type_from_job); |
356 } | 356 } |
357 | 357 |
358 } // namespace | 358 } // namespace |
359 } // namespace fileapi | 359 } // namespace fileapi |
OLD | NEW |