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

Side by Side Diff: chrome/test/data/pdf/bookmarks_test.js

Issue 840493002: Introduce new test for bookmark loading. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bookmarks-minimal
Patch Set: Use ScriptingAPI to wait for bookmarks Created 5 years, 11 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 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
5 var tests = [
6
7 /**
8 * Test that the correct bookmarks were loaded for the basic pdf
raymes 2015/01/15 05:40:19 nit: Maybe actually specify the name of the pdf fi
Alexandre Carlton 2015/01/16 02:39:07 Done.
9 */
10 function testHasCorrectBookmarks() {
11 var bookmarks = viewer.bookmarks_;
12
13 // Loading all relevant bookmarks
raymes 2015/01/15 05:40:19 nit: add full stop
Alexandre Carlton 2015/01/16 02:39:07 Done.
14 chrome.test.assertEq(2, bookmarks.length);
15 var firstBookmark = bookmarks[0];
16 var secondBookmark = bookmarks[1];
17 chrome.test.assertEq(1, firstBookmark.children.length);
18 chrome.test.assertEq(0, secondBookmark.children.length);
19 var firstNestedBookmark = firstBookmark.children[0];
20
21 // Checking titles
22 chrome.test.assertEq('First Section',
23 firstBookmark.title);
24 chrome.test.assertEq('First Subsection',
25 firstNestedBookmark.title);
26 chrome.test.assertEq('Second Section',
27 secondBookmark.title);
28 // Checking pages
29 chrome.test.assertEq(0, firstBookmark.page);
30 chrome.test.assertEq(1, firstNestedBookmark.page);
31 chrome.test.assertEq(2, secondBookmark.page);
32
33 chrome.test.succeed();
34 }
35 ];
36
37 var scriptingAPI = new PDFScriptingAPI(window, window);
38 scriptingAPI.setLoadCallback(function() {
39 chrome.test.runTests(tests);
40 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698