OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 package org.chromium.net; | 5 package org.chromium.net; |
6 | 6 |
7 import android.os.ConditionVariable; | 7 import android.os.ConditionVariable; |
8 import android.test.suitebuilder.annotation.SmallTest; | 8 import android.test.suitebuilder.annotation.SmallTest; |
9 | 9 |
10 import org.chromium.base.test.util.Feature; | 10 import org.chromium.base.test.util.Feature; |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 UrlRequest.Builder builder = | 254 UrlRequest.Builder builder = |
255 new UrlRequest.Builder(url, callback, callback.getExecutor(), cr
onetEngine); | 255 new UrlRequest.Builder(url, callback, callback.getExecutor(), cr
onetEngine); |
256 builder.build().start(); | 256 builder.build().start(); |
257 callback.blockForDone(); | 257 callback.blockForDone(); |
258 return callback; | 258 return callback; |
259 } | 259 } |
260 | 260 |
261 // Returns whether a file contains a particular string. | 261 // Returns whether a file contains a particular string. |
262 private boolean fileContainsString(String filename, String content) throws I
OException { | 262 private boolean fileContainsString(String filename, String content) throws I
OException { |
263 BufferedReader reader = new BufferedReader( | 263 BufferedReader reader = new BufferedReader( |
264 new FileReader(mTestFramework.getTestStorage() + "/" + filename)
); | 264 new FileReader(CronetTestFramework.getTestStorage(getContext())
+ "/" + filename)); |
265 String line; | 265 String line; |
266 while ((line = reader.readLine()) != null) { | 266 while ((line = reader.readLine()) != null) { |
267 if (line.contains(content)) { | 267 if (line.contains(content)) { |
268 reader.close(); | 268 reader.close(); |
269 return true; | 269 return true; |
270 } | 270 } |
271 } | 271 } |
272 reader.close(); | 272 reader.close(); |
273 return false; | 273 return false; |
274 } | 274 } |
275 } | 275 } |
OLD | NEW |