OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 var scriptingAPI; | 5 var scriptingAPI; |
6 | 6 |
7 /** | 7 /** |
8 * These tests require that the PDF plugin be available to run correctly. | 8 * These tests require that the PDF plugin be available to run correctly. |
9 */ | 9 */ |
10 var tests = [ | 10 var tests = [ |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 }), 0); | 48 }), 0); |
49 }, | 49 }, |
50 | 50 |
51 function testGetSelectedText() { | 51 function testGetSelectedText() { |
52 var client = new PDFScriptingAPI(window, window); | 52 var client = new PDFScriptingAPI(window, window); |
53 client.selectAll(); | 53 client.selectAll(); |
54 client.getSelectedText(chrome.test.callbackPass(function(selectedText) { | 54 client.getSelectedText(chrome.test.callbackPass(function(selectedText) { |
55 chrome.test.assertEq('this is some text\nsome more text', selectedText); | 55 chrome.test.assertEq('this is some text\nsome more text', selectedText); |
56 })); | 56 })); |
57 }, | 57 }, |
| 58 |
| 59 /** |
| 60 * Test that the filename is used as the title.pdf. |
| 61 */ |
| 62 function testHasCorrectTitle() { |
| 63 chrome.test.assertEq('test.pdf', document.title); |
| 64 |
| 65 chrome.test.succeed(); |
| 66 }, |
58 ]; | 67 ]; |
59 | 68 |
60 var scriptingAPI = new PDFScriptingAPI(window, window); | 69 var scriptingAPI = new PDFScriptingAPI(window, window); |
61 scriptingAPI.setLoadCallback(function() { | 70 scriptingAPI.setLoadCallback(function() { |
62 chrome.test.runTests(tests); | 71 chrome.test.runTests(tests); |
63 }); | 72 }); |
OLD | NEW |