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

Unified Diff: chrome/test/data/extensions/api_test/history/get_most_visited.js

Issue 9721013: Move topSites API out of experimental (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Changes to reflect revision 127555 Created 8 years, 9 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/test/data/extensions/api_test/history/get_most_visited.js
diff --git a/chrome/test/data/extensions/api_test/history/get_most_visited.js b/chrome/test/data/extensions/api_test/history/get_most_visited.js
new file mode 100644
index 0000000000000000000000000000000000000000..adec9458eb7163e38d572bc50177aa8140a5efc1
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/history/get_most_visited.js
@@ -0,0 +1,47 @@
+// Copyright (c) 2012 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.
+
+// History api test for Chrome.
+// browser_tests --gtest_filter=HistoryExtensionApiTest.GetMostVisited
+
+// runHistoryTestFns is defined in ./common.js .
+
+var regex_urls = [
+ /chrome-extension\:\/\/[a-p]{32}\/test1.html/,
+ /chrome-extension\:\/\/[a-p]{32}\/test2.html/,
+ /chrome-extension\:\/\/[a-p]{32}\/test3.html/,
+ /chrome-extension\:\/\/[a-p]{32}\/get_most_visited.html/
+];
+
+var titles = [
+ "Test1",
+ "Test2",
+ "Test3",
+ "Get Most Visited"
+];
+
+
+runHistoryTestFns([
+ function getMostVisitedAll() {
+ chrome.history.getMostVisited({'maxResults':100}, function(items) {
+ assertEq(4, items.length);
+ for (var i = 0; i< items.length; i++) {
+ assertTrue(regex_urls[i].test(items[i].url));
+ assertEq(titles[i], items[i].title);
+ assertEq(items[i].redirects.length, 1);
Aaron Boodman 2012/03/20 02:24:24 In unit testing asserts that have two terms, the e
+ }
+ chrome.test.succeed();
+ });
+
+ chrome.history.getMostVisited({'maxResults':2}, function(items) {
+ assertEq(2, items.length);
+ for (var i = 0; i< items.length; i++) {
+ assertTrue(regex_urls[i].test(items[i].url));
+ assertEq(titles[i], items[i].title);
+ assertEq(items[i].redirects.length, 1);
+ }
+ chrome.test.succeed();
+ });
+ }
+]);

Powered by Google App Engine
This is Rietveld 408576698