| 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/browser/fileapi/local_file_stream_writer.h" |    5 #include "webkit/browser/fileapi/local_file_stream_writer.h" | 
|    6  |    6  | 
|    7 #include <string> |    7 #include <string> | 
|    8  |    8  | 
|    9 #include "base/callback.h" |    9 #include "base/callback.h" | 
|   10 #include "base/file_util.h" |   10 #include "base/file_util.h" | 
|   11 #include "base/files/scoped_temp_dir.h" |   11 #include "base/files/scoped_temp_dir.h" | 
|   12 #include "base/logging.h" |   12 #include "base/logging.h" | 
|   13 #include "base/memory/scoped_ptr.h" |   13 #include "base/memory/scoped_ptr.h" | 
|   14 #include "base/message_loop.h" |   14 #include "base/message_loop/message_loop.h" | 
|   15 #include "base/threading/thread.h" |   15 #include "base/threading/thread.h" | 
|   16 #include "net/base/io_buffer.h" |   16 #include "net/base/io_buffer.h" | 
|   17 #include "net/base/test_completion_callback.h" |   17 #include "net/base/test_completion_callback.h" | 
|   18 #include "testing/gtest/include/gtest/gtest.h" |   18 #include "testing/gtest/include/gtest/gtest.h" | 
|   19  |   19  | 
|   20 namespace { |   20 namespace { | 
|   21  |   21  | 
|   22 using fileapi::LocalFileStreamWriter; |   22 using fileapi::LocalFileStreamWriter; | 
|   23  |   23  | 
|   24 class LocalFileStreamWriterTest : public testing::Test { |   24 class LocalFileStreamWriterTest : public testing::Test { | 
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  171   scoped_refptr<net::StringIOBuffer> buffer(new net::StringIOBuffer("xxx")); |  171   scoped_refptr<net::StringIOBuffer> buffer(new net::StringIOBuffer("xxx")); | 
|  172   int result = |  172   int result = | 
|  173       writer->Write(buffer.get(), buffer->size(), base::Bind(&NeverCalled)); |  173       writer->Write(buffer.get(), buffer->size(), base::Bind(&NeverCalled)); | 
|  174   ASSERT_EQ(net::ERR_IO_PENDING, result); |  174   ASSERT_EQ(net::ERR_IO_PENDING, result); | 
|  175  |  175  | 
|  176   net::TestCompletionCallback callback; |  176   net::TestCompletionCallback callback; | 
|  177   writer->Cancel(callback.callback()); |  177   writer->Cancel(callback.callback()); | 
|  178   int cancel_result = callback.WaitForResult(); |  178   int cancel_result = callback.WaitForResult(); | 
|  179   EXPECT_EQ(net::OK, cancel_result); |  179   EXPECT_EQ(net::OK, cancel_result); | 
|  180 } |  180 } | 
| OLD | NEW |