Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: android_webview/browser/net/input_stream_reader_unittest.cc

Issue 1852513003: Convert //android_webview to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git is hard Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "android_webview/browser/net/input_stream_reader.h"
6
5 #include "android_webview/browser/input_stream.h" 7 #include "android_webview/browser/input_stream.h"
6 #include "android_webview/browser/net/input_stream_reader.h"
7 #include "base/android/scoped_java_ref.h" 8 #include "base/android/scoped_java_ref.h"
8 #include "base/callback.h" 9 #include "base/callback.h"
9 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "net/base/io_buffer.h" 11 #include "net/base/io_buffer.h"
12 #include "net/http/http_byte_range.h" 12 #include "net/http/http_byte_range.h"
13
14 #include "testing/gmock/include/gmock/gmock.h" 13 #include "testing/gmock/include/gmock/gmock.h"
15 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
16 15
17 using android_webview::InputStream; 16 using android_webview::InputStream;
18 using android_webview::InputStreamReader; 17 using android_webview::InputStreamReader;
19 using testing::DoAll; 18 using testing::DoAll;
20 using testing::Ge; 19 using testing::Ge;
21 using testing::InSequence; 20 using testing::InSequence;
22 using testing::Lt; 21 using testing::Lt;
23 using testing::Ne; 22 using testing::Ne;
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 TEST_F(InputStreamReaderTest, ReadSuccess) { 162 TEST_F(InputStreamReaderTest, ReadSuccess) {
164 const int bytesToRead = 128; 163 const int bytesToRead = 128;
165 scoped_refptr<net::IOBuffer> buffer = new net::IOBuffer(bytesToRead); 164 scoped_refptr<net::IOBuffer> buffer = new net::IOBuffer(bytesToRead);
166 165
167 EXPECT_CALL(input_stream_, Read(buffer.get(), bytesToRead, NotNull())) 166 EXPECT_CALL(input_stream_, Read(buffer.get(), bytesToRead, NotNull()))
168 .WillOnce(DoAll(SetArgPointee<2>(bytesToRead), 167 .WillOnce(DoAll(SetArgPointee<2>(bytesToRead),
169 Return(true))); 168 Return(true)));
170 169
171 ASSERT_EQ(bytesToRead, ReadRawData(buffer, bytesToRead)); 170 ASSERT_EQ(bytesToRead, ReadRawData(buffer, bytesToRead));
172 } 171 }
OLDNEW
« no previous file with comments | « android_webview/browser/net/init_native_callback.h ('k') | android_webview/browser/net/token_binding_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698