| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chrome.browser.bookmarks; | 5 package org.chromium.chrome.browser.bookmarks; |
| 6 | 6 |
| 7 import android.support.test.annotation.UiThreadTest; | 7 import android.support.test.annotation.UiThreadTest; |
| 8 import android.support.test.filters.SmallTest; | 8 import android.support.test.filters.SmallTest; |
| 9 import android.support.test.rule.UiThreadTestRule; | 9 import android.support.test.rule.UiThreadTestRule; |
| 10 | 10 |
| 11 import org.junit.Assert; | 11 import org.junit.Assert; |
| 12 import org.junit.Before; | 12 import org.junit.Before; |
| 13 import org.junit.Rule; | 13 import org.junit.Rule; |
| 14 import org.junit.Test; | 14 import org.junit.Test; |
| 15 import org.junit.rules.RuleChain; | 15 import org.junit.rules.RuleChain; |
| 16 import org.junit.runner.RunWith; | 16 import org.junit.runner.RunWith; |
| 17 | 17 |
| 18 import org.chromium.base.ThreadUtils; | 18 import org.chromium.base.ThreadUtils; |
| 19 import org.chromium.base.test.BaseJUnit4ClassRunner; | 19 import org.chromium.base.test.BaseJUnit4ClassRunner; |
| 20 import org.chromium.base.test.util.DisabledTest; |
| 20 import org.chromium.base.test.util.Feature; | 21 import org.chromium.base.test.util.Feature; |
| 21 import org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkItem; | 22 import org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkItem; |
| 22 import org.chromium.chrome.browser.profiles.Profile; | 23 import org.chromium.chrome.browser.profiles.Profile; |
| 23 import org.chromium.chrome.browser.test.ChromeBrowserTestRule; | 24 import org.chromium.chrome.browser.test.ChromeBrowserTestRule; |
| 24 import org.chromium.chrome.test.util.BookmarkTestUtil; | 25 import org.chromium.chrome.test.util.BookmarkTestUtil; |
| 25 import org.chromium.components.bookmarks.BookmarkId; | 26 import org.chromium.components.bookmarks.BookmarkId; |
| 26 | 27 |
| 27 import java.util.ArrayList; | 28 import java.util.ArrayList; |
| 28 import java.util.Arrays; | 29 import java.util.Arrays; |
| 29 import java.util.HashMap; | 30 import java.util.HashMap; |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 | 132 |
| 132 List<BookmarkId> folderList = new ArrayList<BookmarkId>(); | 133 List<BookmarkId> folderList = new ArrayList<BookmarkId>(); |
| 133 List<Integer> depthList = new ArrayList<Integer>(); | 134 List<Integer> depthList = new ArrayList<Integer>(); |
| 134 mBookmarkBridge.getAllFoldersWithDepths(folderList, depthList); | 135 mBookmarkBridge.getAllFoldersWithDepths(folderList, depthList); |
| 135 verifyFolderDepths(folderList, depthList, idToDepth); | 136 verifyFolderDepths(folderList, depthList, idToDepth); |
| 136 } | 137 } |
| 137 | 138 |
| 138 @Test | 139 @Test |
| 139 @SmallTest | 140 @SmallTest |
| 140 @UiThreadTest | 141 @UiThreadTest |
| 142 @DisabledTest // Timing out on the try bot. http://crbug.com/740786 |
| 141 @Feature({"Bookmark"}) | 143 @Feature({"Bookmark"}) |
| 142 public void testGetMoveDestinations() throws Throwable { | 144 public void testGetMoveDestinations() throws Throwable { |
| 143 BookmarkId folderA = mBookmarkBridge.addFolder(mMobileNode, 0, "a"); | 145 BookmarkId folderA = mBookmarkBridge.addFolder(mMobileNode, 0, "a"); |
| 144 BookmarkId folderB = mBookmarkBridge.addFolder(mDesktopNode, 0, "b"); | 146 BookmarkId folderB = mBookmarkBridge.addFolder(mDesktopNode, 0, "b"); |
| 145 BookmarkId folderC = mBookmarkBridge.addFolder(mOtherNode, 0, "c"); | 147 BookmarkId folderC = mBookmarkBridge.addFolder(mOtherNode, 0, "c"); |
| 146 BookmarkId folderAA = mBookmarkBridge.addFolder(folderA, 0, "aa"); | 148 BookmarkId folderAA = mBookmarkBridge.addFolder(folderA, 0, "aa"); |
| 147 BookmarkId folderBA = mBookmarkBridge.addFolder(folderB, 0, "ba"); | 149 BookmarkId folderBA = mBookmarkBridge.addFolder(folderB, 0, "ba"); |
| 148 BookmarkId folderAAA = mBookmarkBridge.addFolder(folderAA, 0, "aaa"); | 150 BookmarkId folderAAA = mBookmarkBridge.addFolder(folderAA, 0, "aaa"); |
| 149 | 151 |
| 150 mBookmarkBridge.addBookmark(mMobileNode, 0, "ua", "http://www.google.com
"); | 152 mBookmarkBridge.addBookmark(mMobileNode, 0, "ua", "http://www.google.com
"); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 Assert.assertTrue( | 226 Assert.assertTrue( |
| 225 "Returned list contained unexpected key: ", idToDepth.contai
nsKey(folder)); | 227 "Returned list contained unexpected key: ", idToDepth.contai
nsKey(folder)); |
| 226 Assert.assertEquals(idToDepth.get(folder), depth); | 228 Assert.assertEquals(idToDepth.get(folder), depth); |
| 227 idToDepth.remove(folder); | 229 idToDepth.remove(folder); |
| 228 } | 230 } |
| 229 Assert.assertEquals(idToDepth.size(), 0); | 231 Assert.assertEquals(idToDepth.size(), 0); |
| 230 folderList.clear(); | 232 folderList.clear(); |
| 231 depthList.clear(); | 233 depthList.clear(); |
| 232 } | 234 } |
| 233 } | 235 } |
| OLD | NEW |