Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/http/tests/inspector/devtools-js/console-clear.js |
| diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/devtools-js/console-clear.js b/third_party/WebKit/LayoutTests/http/tests/inspector/devtools-js/console-clear.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..9218aecb2041200641cd56576598dae46e5bb8bc |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/devtools-js/console-clear.js |
| @@ -0,0 +1,29 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +(async function() { |
| + TestRunner.addResult("Tests that console is cleared upon requestClearMessages call.\n"); |
| + |
| + await TestRunner.loadPanel("console") |
| + await TestRunner.loadLazyModules(["console_test_runner"]); |
|
dgozman
2017/06/19 22:55:51
loadModule("console_test_runner")
chenwilliam
2017/06/19 23:48:17
Done.
|
| + |
| + function log() { |
| + // Fill console. |
| + console.log("one"); |
| + console.log("two"); |
| + console.log("three"); |
| + } |
| + |
| + await TestRunner.evaluateInPagePromise(`(${log.toString()})()`); |
| + TestRunner.addResult("=== Before clear ==="); |
| + ConsoleTestRunner.dumpConsoleMessages(); |
| + |
| + Console.ConsoleView.clearConsole(); |
| + TestRunner.deprecatedRunAfterPendingDispatches(callback); |
| + function callback() { |
| + TestRunner.addResult("=== After clear ==="); |
| + ConsoleTestRunner.dumpConsoleMessages(); |
| + TestRunner.completeTest(); |
| + } |
| +})(); |