Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / chrome / test / data / pdf / basic_plugin_test.js
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
3 // found in the LICENSE file.
4
5 /**
6  * These tests require that the PDF plugin be available to run correctly.
7  */
8 var tests = [
9   /**
10    * Test that the page is sized to the size of the document.
11    */
12   function testPageSize() {
13     // Verify that the initial zoom is 100%.
14     chrome.test.assertEq(1, viewer.viewport.zoom);
15
16     var sizer = document.getElementById('sizer');
17     chrome.test.assertEq(826, sizer.offsetWidth);
18     chrome.test.assertEq(1066, sizer.offsetHeight);
19   }
20 ];
21
22 function runTests() {
23   for (var i = 0; i < tests.length; ++i) {
24     console.log('Running: ' + tests[i].name);
25     tests[i]();
26   }
27   chrome.test.notifyPass();
28 }
29
30 window.addEventListener('pdfload', runTests);