From 3a075e1fe68e5b79607e4a39d68f0256671d92d1 Mon Sep 17 00:00:00 2001 From: "brg@chromium.com" Date: Fri, 30 Oct 2009 06:37:39 +0000 Subject: Remove redundant tests for chrome.experimental.history API. The functionality in the listen tests was added to the primary API tests when they were rewritten to be event driven. TEST=ExtensionApiTest.History BUG=none Review URL: http://codereview.chromium.org/341047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30563 0039d316-1c4b-4281-b951-d872f2087c98 --- .../test/data/extensions/api_test/history/test.js | 108 --------------------- 1 file changed, 108 deletions(-) (limited to 'chrome/test') diff --git a/chrome/test/data/extensions/api_test/history/test.js b/chrome/test/data/extensions/api_test/history/test.js index a97c11b..5e6f4e0 100644 --- a/chrome/test/data/extensions/api_test/history/test.js +++ b/chrome/test/data/extensions/api_test/history/test.js @@ -487,112 +487,4 @@ chrome.test.runTests([ populateHistory([urls[itemsAdded]], function() { }); }); }, - - // This test has the following format. From the main entry point we - // attach a listener and give that listener a state to callback on. After - // receipt of the first message we validate it is as excepted in - // 'firsPageVisit.' We update the callback to 'secondPageVisit' and modify - //the history. - function listenForAdd() { - function secondPageVisit(visited) { - // Update state machine. - itemVisitedCallback = null; - chrome.experimental.history.onVisited.removeListener(itemVisitedListener); - - // Validate the state. - countItemsInHistory(function(count) { - assertEq(2, count); - assertEq(PICASA_URL, visited.url); - - // The test has succeeded. - chrome.test.succeed(); - }); - }; - - function firstPageVisit(visited) { - // Update state machine. - itemVisitedCallback = secondPageVisit; - - // Validate the state. - countItemsInHistory(function(count) { - assertEq(1, count); - assertEq(GOOGLE_URL, visited.url); - - // Transistion to next state. - populateHistory([PICASA_URL], function() { - }); - }); - }; - - // Populate the history one item at a time. - itemVisitedCallback = firstPageVisit; - chrome.experimental.history.onVisited.addListener(itemVisitedListener); - - chrome.experimental.history.deleteAll(function() { - populateHistory([GOOGLE_URL], function() { - }); - }); - }, - - function listenForDelete() { - var urls = [GOOGLE_URL, PICASA_URL]; - var visited_urls = {}; - - // Callback for deletions. - function deleteRangeCallback(removed) { - // We will no longer need to listen to deletions. - itemRemovedCallback = null; - chrome.experimental.history.onVisitRemoved.removeListener( - itemRemovedListener); - - // The two added urls should have been deleted together. - assertEq(false, removed.allHistory); - assertEq(2, removed.urls.length); - - // History should be empty. - countItemsInHistory(function(count) { - assertEq(0, count); - - // The test has succeeded. - chrome.test.succeed(); - }); - }; - - // Callback for page visits. - function historyPopulatedCallback(visited) { - visited_urls[visited_urls.length] = visited.url; - - if (visited_urls.length < urls.length) { - return; - } - - // We will no longer need to listen to visits. - itemVisitedCallback = null; - chrome.experimental.history.onVisited.removeListener(itemVisitedListener); - countItemsInHistory(function(count) { - assertEq(2, count); - - var startDate = new Date(); - startDate.setDate(startDate.getDate() - 1); - var endDate = new Date(); - chrome.experimental.history.deleteRange( - { 'startTime': startDate.getTime(), 'endTime': endDate.getTime() }, - function() { }); - }); - }; - - // We must be called back after the initial - itemVisitedCallback = historyPopulatedCallback; - chrome.experimental.history.onVisited.addListener(itemVisitedListener); - - chrome.experimental.history.deleteAll(function() { - // Do not add the listener until after we have reset the state of history. - itemRemovedCallback = deleteRangeCallback; - chrome.experimental.history.onVisitRemoved.addListener( - itemRemovedListener); - - // This call triggers the onVisited event handler. - populateHistory(urls, function() { }); - }); - }, ]); -- cgit v1.1