mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-03-22 20:54:43 +00:00
add console test
This commit is contained in:
28
src/browser/tests/console/console.html
Normal file
28
src/browser/tests/console/console.html
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<script src="../testing.js"></script>
|
||||||
|
|
||||||
|
<script id="time">
|
||||||
|
// should not crash
|
||||||
|
console.time();
|
||||||
|
console.timeLog();
|
||||||
|
console.timeEnd();
|
||||||
|
|
||||||
|
console.time("test");
|
||||||
|
console.timeLog("test");
|
||||||
|
console.timeEnd("test");
|
||||||
|
|
||||||
|
testing.expectEqual(true, true);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script id="count">
|
||||||
|
// should not crash
|
||||||
|
console.count();
|
||||||
|
console.count();
|
||||||
|
console.countReset();
|
||||||
|
|
||||||
|
console.count("test");
|
||||||
|
console.count("test");
|
||||||
|
console.countReset("test");
|
||||||
|
|
||||||
|
testing.expectEqual(true, true);
|
||||||
|
</script>
|
||||||
@@ -185,3 +185,8 @@ pub const JsApi = struct {
|
|||||||
pub const timeLog = bridge.function(Console.timeLog, .{});
|
pub const timeLog = bridge.function(Console.timeLog, .{});
|
||||||
pub const timeEnd = bridge.function(Console.timeEnd, .{});
|
pub const timeEnd = bridge.function(Console.timeEnd, .{});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const testing = @import("../../testing.zig");
|
||||||
|
test "WebApi: Console" {
|
||||||
|
try testing.htmlRunner("console", .{});
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user