1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 package org.chromium.components.devtools_bridge.util;
7 import android.util.JsonReader;
8 import android.util.JsonWriter;
10 import java.io.StringReader;
11 import java.io.StringWriter;
14 * Helper class for testing JSON-based readers.
16 public class TestSource {
17 private final StringWriter mSource;
18 private final JsonWriter mSourceWriter;
21 mSource = new StringWriter();
22 mSourceWriter = new JsonWriter(mSource);
25 public JsonReader read() {
26 return new JsonReader(new StringReader(mSource.toString()));
29 public JsonWriter write() {