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.
5 function testLogText() {
6 var divLogs = document.getElementById('log-entries');
7 assertNotEquals(null, divLogs, "The <div> with logs not found.");
9 divLogs.innerHTML.match(/text for testing/),
10 "The logged text not found.");
12 divLogs.innerHTML.match(/<script>/),
13 "The logged text was not escaped.");
16 function testLogEmpty() {
17 var divLogs = document.getElementById('log-entries');
18 assertNotEquals(null, divLogs, "The <div> with logs not found.");
20 divLogs.innerHTML.match(/[^\s]/),
21 "There were some logs:" + divLogs.innerHTML);
24 function testNonIncognitoDescription() {
25 var body = document.getElementsByTagName('body')[0];
26 var bodyText = body.innerText;
27 var match = bodyText.match(/logs are listed below/);
28 assertEquals(1, match.length,
29 "Where are the logs in: " + bodyText);
30 match = bodyText.match(/in Incognito/);
31 assertEquals(null, match);
34 function testIncognitoDescription() {
35 var body = document.getElementsByTagName('body')[0];
36 var bodyText = body.innerText;
37 var match = bodyText.match(/in Incognito/);
38 assertEquals(1, match.length,
39 "Where is Incognito in: " + bodyText);
40 match = bodyText.match(/logs are listed below/);
41 assertEquals(null, match);