Reland "Non-SFI mode: Switch to newlib. (patchset #4 id:60001 of https://codereview...
[chromium-blink-merge.git] / chrome / test / data / webui / net_internals / chromeos_view.js
blob35454b122eb24d094dd501351e805938ced67f92
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 // Include test fixture.
6 GEN_INCLUDE(['net_internals_test.js']);
8 // Anonymous namespace
9 (function() {
11 function DebugLogsStatusWatcher() {
12 NetInternalsTest.Task.call(this);
13 this.setCompleteAsync(true);
16 DebugLogsStatusWatcher.prototype = {
17 __proto__: NetInternalsTest.Task.prototype,
19 start: function() {
20 g_browser.addStoreDebugLogsObserver(this);
21 $('chromeos-view-store-debug-logs').click();
24 onStoreDebugLogs: function(status) {
25 if (status.indexOf('Created') != -1) {
26 this.onTaskDone(true);
27 return;
29 if (status.indexOf('Failed') != -1) {
30 this.onTaskDone(false);
31 return;
36 function ResultChecker() {
37 NetInternalsTest.Task.call(this);
40 ResultChecker.prototype = {
41 __proto__: NetInternalsTest.Task.prototype,
43 start: function(success) {
44 assertTrue(success);
45 this.onTaskDone();
49 TEST_F('NetInternalsTest',
50 'netInternalsChromeOSViewStoreDebugLogs',
51 function() {
52 if (!cr.isChromeOS) {
53 testDone();
54 return;
57 // #chromeos-view-import-onc fails accessibility check.
58 this.runAccessibilityChecks = false;
59 NetInternalsTest.switchToView('chromeos');
61 var taskQueue = new NetInternalsTest.TaskQueue(true);
62 taskQueue.addTask(new DebugLogsStatusWatcher());
63 taskQueue.addTask(new ResultChecker());
64 taskQueue.run();
65 });
67 })(); // Anonymous namespace