| Index: components/devtools_bridge/test/android/javatests/src/org/chromium/components/devtools_bridge/util/TestSource.java
|
| diff --git a/components/devtools_bridge/test/android/javatests/src/org/chromium/components/devtools_bridge/util/TestSource.java b/components/devtools_bridge/test/android/javatests/src/org/chromium/components/devtools_bridge/util/TestSource.java
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..9a53a39f458581633caf8dcbfecefad2e7a6d529
|
| --- /dev/null
|
| +++ b/components/devtools_bridge/test/android/javatests/src/org/chromium/components/devtools_bridge/util/TestSource.java
|
| @@ -0,0 +1,32 @@
|
| +// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +package org.chromium.components.devtools_bridge.util;
|
| +
|
| +import android.util.JsonReader;
|
| +import android.util.JsonWriter;
|
| +
|
| +import java.io.StringReader;
|
| +import java.io.StringWriter;
|
| +
|
| +/**
|
| + * Helper class for testing JSON-based readers.
|
| + */
|
| +public class TestSource {
|
| + private final StringWriter mSource;
|
| + private final JsonWriter mSourceWriter;
|
| +
|
| + public TestSource() {
|
| + mSource = new StringWriter();
|
| + mSourceWriter = new JsonWriter(mSource);
|
| + }
|
| +
|
| + public JsonReader read() {
|
| + return new JsonReader(new StringReader(mSource.toString()));
|
| + }
|
| +
|
| + public JsonWriter write() {
|
| + return mSourceWriter;
|
| + }
|
| +}
|
|
|