@@ -0,0 +1,2212 @@
+/* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*-%0A * This Source Code Form is subject to the terms of the Mozilla Public%0A * License, v. 2.0. If a copy of the MPL was not distributed with this%0A * file, You can obtain one at http://mozilla.org/MPL/2.0/. */%0A%0Apackage org.mozilla.focus.web;%0A%0Aimport android.os.Parcel;%0A%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.robolectric.RobolectricTestRunner;%0A%0Aimport static org.junit.Assert.*;%0A%0A@RunWith(RobolectricTestRunner.class)%0Apublic class DownloadTest %7B%0A    @Test%0A    public void testGetters() %7B%0A        final Download download = new Download(%0A                %22https://www.mozilla.org/image.png%22,%0A                %22Focus/1.0%22,%0A                %22Content-Disposition: attachment; filename=%5C%22filename.png%5C%22%22,%0A                %22image/png%22,%0A                1024);%0A%0A        assertEquals(%22https://www.mozilla.org/image.png%22, download.getUrl());%0A        assertEquals(%22Focus/1.0%22, download.getUserAgent());%0A        assertEquals(%22Content-Disposition: attachment; filename=%5C%22filename.png%5C%22%22, download.getContentDisposition());%0A        assertEquals(%22image/png%22, download.getMimeType());%0A        assertEquals(1024, download.getContentLength());%0A    %7D%0A%0A    @Test%0A    public void testParcelable() %7B%0A        final Parcel parcel = Parcel.obtain();%0A%0A        %7B%0A            final Download download = new Download(%0A                    %22https://www.mozilla.org/image.png%22,%0A                    %22Focus/1.0%22,%0A                    %22Content-Disposition: attachment; filename=%5C%22filename.png%5C%22%22,%0A                    %22image/png%22,%0A                    1024);%0A            download.writeToParcel(parcel, 0);%0A        %7D%0A%0A        parcel.setDataPosition(0);%0A%0A        %7B%0A            final Download download = Download.CREATOR.createFromParcel(parcel);%0A%0A            assertEquals(%22https://www.mozilla.org/image.png%22, download.getUrl());%0A            assertEquals(%22Focus/1.0%22, download.getUserAgent());%0A            assertEquals(%22Content-Disposition: attachment; filename=%5C%22filename.png%5C%22%22, download.getContentDisposition());%0A            assertEquals(%22image/png%22, download.getMimeType());%0A            assertEquals(1024, download.getContentLength());%0A        %7D%0A    %7D%0A%7D

Add unit tests for Download class.