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

Unified Diff: components/devtools_bridge/android/javatests/src/org/chromium/components/devtools_bridge/commands/ParamDefinitionsTest.java

Issue 1142463003: Remove devtools_bridge component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: components/devtools_bridge/android/javatests/src/org/chromium/components/devtools_bridge/commands/ParamDefinitionsTest.java
diff --git a/components/devtools_bridge/android/javatests/src/org/chromium/components/devtools_bridge/commands/ParamDefinitionsTest.java b/components/devtools_bridge/android/javatests/src/org/chromium/components/devtools_bridge/commands/ParamDefinitionsTest.java
deleted file mode 100644
index 3bf72c80fe13a4b5e41e60566043f9af241ba12f..0000000000000000000000000000000000000000
--- a/components/devtools_bridge/android/javatests/src/org/chromium/components/devtools_bridge/commands/ParamDefinitionsTest.java
+++ /dev/null
@@ -1,81 +0,0 @@
-// 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.commands;
-
-import android.test.InstrumentationTestCase;
-import android.test.suitebuilder.annotation.SmallTest;
-
-import junit.framework.Assert;
-
-import org.chromium.components.devtools_bridge.RTCConfiguration;
-
-import java.util.List;
-
-/**
- * Tests for {@link ParamDefinitions}
- */
-public class ParamDefinitionsTest extends InstrumentationTestCase {
- @SmallTest
- public void testStringParam() throws Exception {
- ParamDefinition<String> param = ParamDefinitions.newStringParam("NAME");
- Assert.assertEquals("_NAME", param.name());
- Assert.assertEquals("string", param.type());
- Assert.assertEquals("STRING", param.fromString("STRING"));
- Assert.assertEquals("STRING", param.toString("STRING"));
- }
-
- @SmallTest
- public void testStringListParam() throws Exception {
- ParamDefinition<List<String>> param = ParamDefinitions.newStringListParam("NAME");
- Assert.assertEquals("_NAME", param.name());
- Assert.assertEquals("string", param.type());
-
- List<String> value = param.fromString("[\"ITEM1\",\"ITEM2\"]");
- Assert.assertEquals(2, value.size());
- Assert.assertEquals("ITEM1", value.get(0));
- Assert.assertEquals("ITEM2", value.get(1));
-
- try {
- param.fromString("{\"ITEM1\",\"ITEM2\"}");
- Assert.fail("Exception expected");
- } catch (CommandFormatException e) {
- // Expected.
- }
-
- List<String> clone = param.fromString(param.toString(value));
- Assert.assertEquals(value.size(), clone.size());
- Assert.assertEquals(value.get(0), clone.get(0));
- Assert.assertEquals(value.get(1), clone.get(1));
- }
-
- @SmallTest
- public void testConfigParam() throws Exception {
- ParamDefinition<RTCConfiguration> param = ParamDefinitions.newConfigParam("NAME");
- Assert.assertEquals("_NAME", param.name());
- Assert.assertEquals("string", param.type());
-
- RTCConfiguration value = param.fromString(
- "{\"iceServers\": [{\"uri\": \"http://example.org\"}]}");
- Assert.assertNotNull(value);
- Assert.assertEquals(1, value.iceServers.size());
- Assert.assertEquals("http://example.org", value.iceServers.get(0).uri);
-
- try {
- param.fromString("[");
- Assert.fail("Exception expected");
- } catch (CommandFormatException e) {
- // Expected.
- }
-
- value = new RTCConfiguration.Builder()
- .addIceServer("http://example.org/1", "USERNAME", "CREDENTIAL")
- .addIceServer("http://example.org/2", "USERNAME", "CREDENTIAL")
- .build();
- RTCConfiguration clone = param.fromString(param.toString(value));
- Assert.assertEquals(value.iceServers.size(), clone.iceServers.size());
- Assert.assertEquals(value.iceServers.get(0).username, clone.iceServers.get(0).username);
- Assert.assertEquals(value.iceServers.get(1).credential, clone.iceServers.get(1).credential);
- }
-}

Powered by Google App Engine
This is Rietveld 408576698