| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/callback.h" | 6 #include "base/callback.h" |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "content/browser/fileapi/chrome_blob_storage_context.h" | 10 #include "content/browser/fileapi/chrome_blob_storage_context.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 ChromeBlobStorageContext* blob_context, | 117 ChromeBlobStorageContext* blob_context, |
| 118 FetchResult* result) { | 118 FetchResult* result) { |
| 119 return base::Bind(&ReceiveFetchResult, run_quit_thread, quit, | 119 return base::Bind(&ReceiveFetchResult, run_quit_thread, quit, |
| 120 make_scoped_refptr<ChromeBlobStorageContext>(blob_context), | 120 make_scoped_refptr<ChromeBlobStorageContext>(blob_context), |
| 121 result); | 121 result); |
| 122 } | 122 } |
| 123 | 123 |
| 124 void ReadResponseBody(std::string* body, | 124 void ReadResponseBody(std::string* body, |
| 125 storage::BlobDataHandle* blob_data_handle) { | 125 storage::BlobDataHandle* blob_data_handle) { |
| 126 ASSERT_TRUE(blob_data_handle); | 126 ASSERT_TRUE(blob_data_handle); |
| 127 ASSERT_EQ(1U, blob_data_handle->data()->items().size()); | 127 scoped_ptr<storage::BlobDataSnapshot> data = |
| 128 *body = std::string(blob_data_handle->data()->items()[0].bytes(), | 128 blob_data_handle->CreateSnapshot(); |
| 129 blob_data_handle->data()->items()[0].length()); | 129 ASSERT_EQ(1U, data->items().size()); |
| 130 *body = std::string(data->items()[0]->bytes(), data->items()[0]->length()); |
| 130 } | 131 } |
| 131 | 132 |
| 132 void ExpectResultAndRun(bool expected, | 133 void ExpectResultAndRun(bool expected, |
| 133 const base::Closure& continuation, | 134 const base::Closure& continuation, |
| 134 bool actual) { | 135 bool actual) { |
| 135 EXPECT_EQ(expected, actual); | 136 EXPECT_EQ(expected, actual); |
| 136 continuation.Run(); | 137 continuation.Run(); |
| 137 } | 138 } |
| 138 | 139 |
| 139 class WorkerActivatedObserver | 140 class WorkerActivatedObserver |
| (...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 969 const base::string16 kOKTitle2(base::ASCIIToUTF16("OK_2")); | 970 const base::string16 kOKTitle2(base::ASCIIToUTF16("OK_2")); |
| 970 const base::string16 kFailTitle2(base::ASCIIToUTF16("FAIL_2")); | 971 const base::string16 kFailTitle2(base::ASCIIToUTF16("FAIL_2")); |
| 971 content::TitleWatcher title_watcher2(shell()->web_contents(), kOKTitle2); | 972 content::TitleWatcher title_watcher2(shell()->web_contents(), kOKTitle2); |
| 972 title_watcher2.AlsoWaitForTitle(kFailTitle2); | 973 title_watcher2.AlsoWaitForTitle(kFailTitle2); |
| 973 | 974 |
| 974 NavigateToURL(shell(), embedded_test_server()->GetURL(kConfirmPageUrl)); | 975 NavigateToURL(shell(), embedded_test_server()->GetURL(kConfirmPageUrl)); |
| 975 EXPECT_EQ(kOKTitle2, title_watcher2.WaitAndGetTitle()); | 976 EXPECT_EQ(kOKTitle2, title_watcher2.WaitAndGetTitle()); |
| 976 } | 977 } |
| 977 | 978 |
| 978 } // namespace content | 979 } // namespace content |
| OLD | NEW |