OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Copyright (c) 2010 The Chromium Authors. All rights reserved. | 3 Copyright (c) 2010 The Chromium Authors. All rights reserved. |
4 Use of this source code is governed by a BSD-style license that can be | 4 Use of this source code is governed by a BSD-style license that can be |
5 found in the LICENSE file. | 5 found in the LICENSE file. |
6 --> | 6 --> |
7 <html> | 7 <html> |
8 <head> | 8 <head> |
9 <title></title> | 9 <title></title> |
10 <link rel="stylesheet" href="overlay.css"> | 10 <link rel="stylesheet" href="overlay.css"> |
11 <script src="http://closure-library.googlecode.com/svn/trunk/closure/goog/base.j
s"></script> | 11 <script src="http://closure-library.googlecode.com/svn/trunk/closure/goog/base.j
s"></script> |
12 <script src="../shared/js/cr.js"></script> | 12 <script src="../shared/js/cr.js"></script> |
13 <script src="../shared/js/cr/ui.js"></script> | 13 <script src="../shared/js/cr/ui.js"></script> |
14 <script src="overlay.js"></script> | 14 <script src="overlay.js"></script> |
15 <script> | 15 <script> |
16 | 16 |
17 goog.require('goog.testing.jsunit'); | 17 goog.require('goog.testing.jsunit'); |
18 | 18 |
19 </script> | 19 </script> |
20 | 20 |
21 </head> | 21 </head> |
22 <body> | 22 <body> |
23 <div id="sandbox"></div> | 23 <div id="sandbox"></div> |
24 <script> | 24 <script> |
25 | 25 |
26 var sandbox = document.getElementById('sandbox'); | 26 var sandbox = document.getElementById('sandbox'); |
27 var overlay; | 27 var overlay; |
28 | 28 |
29 function testShowHideUnparented() { | 29 function testShowHideUnparented() { |
30 overlay = new gpu.Overlay(); | 30 overlay = new tracing.Overlay(); |
31 overlay.innerHTML = | 31 overlay.innerHTML = |
32 '<h3>Hello</h3>B1:<button>foo</button></p>B2:<button>blah</button>'; | 32 '<h3>Hello</h3>B1:<button>foo</button></p>B2:<button>blah</button>'; |
33 overlay.visible = true; | 33 overlay.visible = true; |
34 assertNotEquals(overlay.parentNode, null); | 34 assertNotEquals(overlay.parentNode, null); |
35 | 35 |
36 overlay.visible = false; | 36 overlay.visible = false; |
37 assertEquals(overlay.parentNode, null); | 37 assertEquals(overlay.parentNode, null); |
38 } | 38 } |
39 | 39 |
40 function testShowHideParented() { | 40 function testShowHideParented() { |
41 overlay = new gpu.Overlay(); | 41 overlay = new tracing.Overlay(); |
42 overlay.innerHTML = | 42 overlay.innerHTML = |
43 '<h3>Hello</h3>B1:<button>foo</button></p>B2:<button>blah</button>'; | 43 '<h3>Hello</h3>B1:<button>foo</button></p>B2:<button>blah</button>'; |
44 document.body.appendChild(overlay); | 44 document.body.appendChild(overlay); |
45 overlay.visible = true; | 45 overlay.visible = true; |
46 assertNotEquals(overlay.parentNode, null); | 46 assertNotEquals(overlay.parentNode, null); |
47 | 47 |
48 overlay.visible = false; | 48 overlay.visible = false; |
49 assertEquals(overlay.parentNode, document.body); | 49 assertEquals(overlay.parentNode, document.body); |
50 } | 50 } |
51 | 51 |
52 </script> | 52 </script> |
53 | 53 |
54 </body> | 54 </body> |
55 </html> | 55 </html> |
56 | 56 |
OLD | NEW |