| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 GEN('#include "chrome/test/data/webui/history_ui_browsertest.h"'); | 5 GEN('#include "chrome/test/data/webui/history_ui_browsertest.h"'); |
| 6 | 6 |
| 7 /** @const */ var TOTAL_RESULT_COUNT = 160; | 7 /** @const */ var TOTAL_RESULT_COUNT = 160; |
| 8 /** @const */ var WAIT_TIMEOUT = 200; | 8 /** @const */ var WAIT_TIMEOUT = 200; |
| 9 | 9 |
| 10 /** | 10 /** |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 expectEquals(entryDate.getYear(), date.getYear()); | 410 expectEquals(entryDate.getYear(), date.getYear()); |
| 411 expectEquals(entryDate.getMonth(), date.getMonth()); | 411 expectEquals(entryDate.getMonth(), date.getMonth()); |
| 412 expectEquals(entryDate.getDay(), date.getDay()); | 412 expectEquals(entryDate.getDay(), date.getDay()); |
| 413 expectEquals(entryDate.getHours(), date.getHours()); | 413 expectEquals(entryDate.getHours(), date.getHours()); |
| 414 expectEquals(entryDate.getMinutes(), date.getMinutes()); | 414 expectEquals(entryDate.getMinutes(), date.getMinutes()); |
| 415 } | 415 } |
| 416 } | 416 } |
| 417 | 417 |
| 418 // Check that there are 3 page navigation links and that only the "Older" | 418 // Check that there are 3 page navigation links and that only the "Older" |
| 419 // link is visible. | 419 // link is visible. |
| 420 expectEquals(3, document.querySelectorAll('.link-button').length); | 420 expectEquals(3, document.querySelectorAll('[is="action-link"]').length); |
| 421 expectTrue($('newest-button').hidden); | 421 expectTrue($('newest-button').hidden); |
| 422 expectTrue($('newer-button').hidden); | 422 expectTrue($('newer-button').hidden); |
| 423 expectFalse($('older-button').hidden); | 423 expectFalse($('older-button').hidden); |
| 424 | 424 |
| 425 ensureTimeWidthsEqual(); | 425 ensureTimeWidthsEqual(); |
| 426 | 426 |
| 427 // Go to the next page. | 427 // Go to the next page. |
| 428 $('older-button').click(); | 428 $('older-button').click(); |
| 429 waitForCallback('historyResult', function() { | 429 waitForCallback('historyResult', function() { |
| 430 resultCount += document.querySelectorAll('.entry').length; | 430 resultCount += document.querySelectorAll('.entry').length; |
| 431 | 431 |
| 432 // Check that the two pages include all of the entries. | 432 // Check that the two pages include all of the entries. |
| 433 expectEquals(TOTAL_RESULT_COUNT, resultCount); | 433 expectEquals(TOTAL_RESULT_COUNT, resultCount); |
| 434 | 434 |
| 435 // Check that the day header was properly continued -- the header for the | 435 // Check that the day header was properly continued -- the header for the |
| 436 // last day on the first page should be a substring of the header on the | 436 // last day on the first page should be a substring of the header on the |
| 437 // second page. E.g. "Wed, Oct 8, 2008" and "Web, Oct 8, 2008 - cont'd". | 437 // second page. E.g. "Wed, Oct 8, 2008" and "Web, Oct 8, 2008 - cont'd". |
| 438 var newDayHeaders = document.querySelectorAll('.day'); | 438 var newDayHeaders = document.querySelectorAll('.day'); |
| 439 expectEquals(1, newDayHeaders.length); | 439 expectEquals(1, newDayHeaders.length); |
| 440 expectEquals(0, | 440 expectEquals(0, |
| 441 newDayHeaders[0].textContent.indexOf(dayHeaders[1].textContent)); | 441 newDayHeaders[0].textContent.indexOf(dayHeaders[1].textContent)); |
| 442 | 442 |
| 443 // Check that the "Newest" and "Newer" links are now visible, but the | 443 // Check that the "Newest" and "Newer" links are now visible, but the |
| 444 // "Older" link is hidden. | 444 // "Older" link is hidden. |
| 445 expectEquals(3, document.querySelectorAll('.link-button').length); | 445 expectEquals(3, document.querySelectorAll('[is="action-link"]').length); |
| 446 expectFalse($('newest-button').hidden); | 446 expectFalse($('newest-button').hidden); |
| 447 expectFalse($('newer-button').hidden); | 447 expectFalse($('newer-button').hidden); |
| 448 expectTrue($('older-button').hidden); | 448 expectTrue($('older-button').hidden); |
| 449 | 449 |
| 450 ensureTimeWidthsEqual(); | 450 ensureTimeWidthsEqual(); |
| 451 | 451 |
| 452 // Go back to the first page, and check that the same day headers are there. | 452 // Go back to the first page, and check that the same day headers are there. |
| 453 $('newest-button').click(); | 453 $('newest-button').click(); |
| 454 var newDayHeaders = document.querySelectorAll('.day'); | 454 var newDayHeaders = document.querySelectorAll('.day'); |
| 455 expectEquals(2, newDayHeaders.length); | 455 expectEquals(2, newDayHeaders.length); |
| (...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1053 TEST_F('HistoryWebUIWithSchemesTest', 'groupingWithSchemes', function() { | 1053 TEST_F('HistoryWebUIWithSchemesTest', 'groupingWithSchemes', function() { |
| 1054 // Switch to the week view. | 1054 // Switch to the week view. |
| 1055 $('timeframe-controls').querySelectorAll('input')[1].click(); | 1055 $('timeframe-controls').querySelectorAll('input')[1].click(); |
| 1056 waitForCallback('historyResult', function() { | 1056 waitForCallback('historyResult', function() { |
| 1057 // Each URL should be organized under a different "domain". | 1057 // Each URL should be organized under a different "domain". |
| 1058 expectEquals(document.querySelectorAll('.entry').length, 4); | 1058 expectEquals(document.querySelectorAll('.entry').length, 4); |
| 1059 expectEquals(document.querySelectorAll('.site-domain-wrapper').length, 4); | 1059 expectEquals(document.querySelectorAll('.site-domain-wrapper').length, 4); |
| 1060 testDone(); | 1060 testDone(); |
| 1061 }); | 1061 }); |
| 1062 }); | 1062 }); |
| OLD | NEW |