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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/physicalweb/PwsResultTest.java

Issue 2722623003: Move PwsResultTest to junit (Closed)
Patch Set: Rebase Created 3 years, 10 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: chrome/android/javatests/src/org/chromium/chrome/browser/physicalweb/PwsResultTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/physicalweb/PwsResultTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/physicalweb/PwsResultTest.java
deleted file mode 100644
index 980470d70acf7bf4f275254a6d40d4f8cb408717..0000000000000000000000000000000000000000
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/physicalweb/PwsResultTest.java
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright 2015 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.chrome.browser.physicalweb;
-
-import android.support.test.filters.SmallTest;
-
-import junit.framework.TestCase;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-/**
- * Tests for {@link PwsResult}.
- */
-public class PwsResultTest extends TestCase {
- PwsResult mReferencePwsResult = null;
- JSONObject mReferenceJsonObject = null;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- mReferencePwsResult = new PwsResult(
- "https://shorturl.com",
- "https://longurl.com",
- "https://longurl.com/favicon.ico",
- "This is a page",
- "Pages are the best",
- "group1");
- // Because we can't print JSON sorted by keys, the order is important here.
- mReferenceJsonObject = new JSONObject("{"
- + " \"scannedUrl\": \"https://shorturl.com\","
- + " \"resolvedUrl\": \"https://longurl.com\","
- + " \"icon\": \"https://longurl.com/favicon.ico\","
- + " \"title\": \"This is a page\","
- + " \"description\": \"Pages are the best\","
- + " \"group\": \"group1\""
- + "}");
- }
-
- @SmallTest
- public void testJsonSerializeWorks() throws JSONException {
- assertEquals(mReferenceJsonObject.toString(),
- mReferencePwsResult.jsonSerialize().toString());
- }
-
- @SmallTest
- public void testJsonDeserializeWorks() throws JSONException {
- PwsResult pwsResult = PwsResult.jsonDeserialize(mReferenceJsonObject);
- assertEquals(mReferencePwsResult.requestUrl, pwsResult.requestUrl);
- assertEquals(mReferencePwsResult.responseUrl, pwsResult.responseUrl);
- assertEquals(mReferencePwsResult.iconUrl, pwsResult.iconUrl);
- assertEquals(mReferencePwsResult.title, pwsResult.title);
- assertEquals(mReferencePwsResult.description, pwsResult.description);
- assertEquals(mReferencePwsResult.group, pwsResult.group);
- }
-}
« no previous file with comments | « chrome/android/java_sources.gni ('k') | chrome/android/junit/src/org/chromium/chrome/browser/physicalweb/PwsResultTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698