| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 1 // History api test for Chrome. | 5 // History api test for Chrome. |
| 2 // browser_tests.exe --gtest_filter=ExtensionHistoryApiTest.SearchAfterAdd | 6 // browser_tests.exe --gtest_filter=ExtensionHistoryApiTest.SearchAfterAdd |
| 3 | 7 |
| 4 // runHistoryTestFns is defined in ./common.js . | 8 // runHistoryTestFns is defined in ./common.js . |
| 5 runHistoryTestFns([ | 9 runHistoryTestFns([ |
| 6 function searchAfterAdd() { | 10 function searchAfterAdd() { |
| 7 chrome.history.deleteAll(function() { | 11 chrome.history.deleteAll(function() { |
| 8 var VALID_URL = 'http://www.google.com/'; | 12 var VALID_URL = 'http://www.google.com/'; |
| 9 chrome.history.addUrl({url: VALID_URL}); | 13 chrome.history.addUrl({url: VALID_URL}); |
| 10 chrome.history.search({text: ''}, function(historyItems) { | 14 chrome.history.search({text: ''}, function(historyItems) { |
| 11 assertEq(1, historyItems.length); | 15 assertEq(1, historyItems.length); |
| 12 assertEq(VALID_URL, historyItems[0].url); | 16 assertEq(VALID_URL, historyItems[0].url); |
| 13 chrome.test.succeed(); | 17 chrome.test.succeed(); |
| 14 }); | 18 }); |
| 15 }); | 19 }); |
| 16 } | 20 } |
| 17 ]); | 21 ]); |
| OLD | NEW |