| OLD | NEW | 
|---|
| (Empty) |  | 
|  | 1 // Copyright (c) 2009 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 gotDOMContentLoadedEvent = false; | 
|  | 6 | 
|  | 7 // Test that at parse time, we have the document element. | 
|  | 8 var hasDocumentElement = (document.documentElement.tagName == "HTML"); | 
|  | 9 | 
|  | 10 // TODO(aa): We would like to add more tests here that there are zero child | 
|  | 11 // nodes to the documentElement, but unfortunately run_at:document_start is | 
|  | 12 // currently buggy and doesn't guarantee that. | 
|  | 13 | 
|  | 14 window.addEventListener("DOMContentLoaded", function() { | 
|  | 15   gotDOMContentLoadedEvent = true; | 
|  | 16 }, false); | 
|  | 17 | 
|  | 18 // Don't run tests until onload so that we can test that DOMContentLoaded and | 
|  | 19 // onload happen after this script runs. | 
|  | 20 window.addEventListener("load", runAllTests, false); | 
|  | 21 | 
|  | 22 function testRunAtDocumentStart() { | 
|  | 23   assert(hasDocumentElement); | 
|  | 24 } | 
|  | 25 | 
|  | 26 function testGotLoadEvents() { | 
|  | 27   assert(gotDOMContentLoadedEvent); | 
|  | 28 } | 
| OLD | NEW | 
|---|