| 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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 271         TestUrlRequestCallback callback = new TestUrlRequestCallback(); | 271         TestUrlRequestCallback callback = new TestUrlRequestCallback(); | 
| 272         UrlRequest.Builder builder = | 272         UrlRequest.Builder builder = | 
| 273                 new UrlRequest.Builder(url, callback, callback.getExecutor(), cr
     onetEngine); | 273                 new UrlRequest.Builder(url, callback, callback.getExecutor(), cr
     onetEngine); | 
| 274         builder.build().start(); | 274         builder.build().start(); | 
| 275         callback.blockForDone(); | 275         callback.blockForDone(); | 
| 276         return callback; | 276         return callback; | 
| 277     } | 277     } | 
| 278 | 278 | 
| 279     // Returns whether a file contains a particular string. | 279     // Returns whether a file contains a particular string. | 
| 280     private boolean fileContainsString(String filename, String content) throws I
     OException { | 280     private boolean fileContainsString(String filename, String content) throws I
     OException { | 
| 281         BufferedReader reader = new BufferedReader( | 281         BufferedReader reader = new BufferedReader(new FileReader( | 
| 282                 new FileReader(CronetTestFramework.getTestStorage(getContext()) 
     + "/" + filename)); | 282                 CronetTestFramework.getTestStorage(getContext()) + "/prefs/" + f
     ilename)); | 
| 283         String line; | 283         String line; | 
| 284         while ((line = reader.readLine()) != null) { | 284         while ((line = reader.readLine()) != null) { | 
| 285             if (line.contains(content)) { | 285             if (line.contains(content)) { | 
| 286                 reader.close(); | 286                 reader.close(); | 
| 287                 return true; | 287                 return true; | 
| 288             } | 288             } | 
| 289         } | 289         } | 
| 290         reader.close(); | 290         reader.close(); | 
| 291         return false; | 291         return false; | 
| 292     } | 292     } | 
| 293 } | 293 } | 
| OLD | NEW | 
|---|