| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/renderer/fileapi/webfilewriter_base.h" | 5 #include "webkit/renderer/fileapi/webfilewriter_base.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| 11 #include "googleurl/src/gurl.h" | |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 13 #include "third_party/WebKit/public/platform/WebURL.h" | 12 #include "third_party/WebKit/public/platform/WebURL.h" |
| 14 #include "third_party/WebKit/public/web/WebFileError.h" | 13 #include "third_party/WebKit/public/web/WebFileError.h" |
| 15 #include "third_party/WebKit/public/web/WebFileWriterClient.h" | 14 #include "third_party/WebKit/public/web/WebFileWriterClient.h" |
| 15 #include "url/gurl.h" |
| 16 | 16 |
| 17 namespace fileapi { | 17 namespace fileapi { |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 // We use particular offsets to trigger particular behaviors | 21 // We use particular offsets to trigger particular behaviors |
| 22 // in the TestableFileWriter. | 22 // in the TestableFileWriter. |
| 23 const int kNoOffset = -1; | 23 const int kNoOffset = -1; |
| 24 const int kBasicFileTruncate_Offset = 1; | 24 const int kBasicFileTruncate_Offset = 1; |
| 25 const int kErrorFileTruncate_Offset = 2; | 25 const int kErrorFileTruncate_Offset = 2; |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 | 402 |
| 403 reset(); | 403 reset(); |
| 404 delete_in_client_callback_ = true; | 404 delete_in_client_callback_ = true; |
| 405 writer()->truncate(kErrorFileTruncate_Offset); | 405 writer()->truncate(kErrorFileTruncate_Offset); |
| 406 EXPECT_FALSE(testable_writer_.get()); | 406 EXPECT_FALSE(testable_writer_.get()); |
| 407 | 407 |
| 408 // Not crashing counts as passing. | 408 // Not crashing counts as passing. |
| 409 } | 409 } |
| 410 | 410 |
| 411 } // namespace fileapi | 411 } // namespace fileapi |
| OLD | NEW |