Skip to content

Commit 2be4eeb

Browse files
LiedtkeV8-internal LUCI CQ
authored andcommitted
[test] Remove obsolete test case for registered global builtins
This test case is obsolete. For detecting missing builtins, there is now a script that can recursively scan the available global context of a JavaScript shell. Bug: 487347678 Change-Id: If785dc73fca43d693e29d1c22e345381568072bd Reviewed-on: https://chrome-internal-review.googlesource.com/c/v8/fuzzilli/+/9064301 Commit-Queue: Matthias Liedtke <mliedtke@google.com> Reviewed-by: Danylo Mocherniuk <mdanylo@google.com>
1 parent 8aba53c commit 2be4eeb

1 file changed

Lines changed: 0 additions & 58 deletions

File tree

Tests/FuzzilliTests/EnvironmentTest.swift

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -73,64 +73,6 @@ class EnvironmentTests: XCTestCase {
7373
testForOutput(program: jsProg, runner: runner, outputString: "")
7474
}
7575

76-
/// Test that all interesting properties on the globalThis object are registered as builtins.
77-
func testJSEnvironmentRegisteredBuiltins() throws {
78-
let runner = try GetJavaScriptExecutorOrSkipTest(type: .user, withArguments: [])
79-
let liveTestConfig = Configuration(logLevel: .error, enableInspection: true)
80-
let fuzzer = makeMockFuzzer(config: liveTestConfig, environment: JavaScriptEnvironment())
81-
let b = fuzzer.makeBuilder()
82-
83-
let globalThis = b.createNamedVariable(forBuiltin: "globalThis")
84-
let object = b.createNamedVariable(forBuiltin: "Object")
85-
let names = b.callMethod("getOwnPropertyNames", on: object, withArgs: [globalThis])
86-
let namesString = b.callMethod("join", on: names, withArgs: [b.loadString(",")])
87-
b.callFunction(b.createNamedVariable(forBuiltin: "output"), withArgs: [namesString])
88-
89-
let prog = b.finalize()
90-
let jsProg = fuzzer.lifter.lift(prog, withOptions: [])
91-
let jsEnvironment = b.fuzzer.environment
92-
let result = testExecuteScript(program: jsProg, runner: runner)
93-
XCTAssert(result.isSuccess, "\(result.error)\n\(result.output)")
94-
var output = result.output
95-
XCTAssertEqual(output.removeLast(), "\n")
96-
97-
// Global builtins available in d8 that should not be fuzzed.
98-
let skipped = [
99-
"fuzzilli", "testRunner", "quit", "load", "read", "readline", "readbuffer",
100-
"writeFile", "write", "print", "printErr", "version", "os", "d8", "arguments", "Realm"
101-
]
102-
// Global builtins that we probably should register but haven't done so, yet.
103-
let TODO = [
104-
"globalThis",
105-
"Iterator",
106-
"setTimeout",
107-
"console",
108-
"escape",
109-
"onerror",
110-
"unescape",
111-
"encodeURIComponent",
112-
"encodeURI",
113-
"decodeURIComponent",
114-
"decodeURI",
115-
// https://github.com/tc39/proposal-ecmascript-sharedmem/tree/main
116-
"Atomics",
117-
// https://github.com/tc39/proposal-explicit-resource-management
118-
"DisposableStack",
119-
"AsyncDisposableStack",
120-
// https://github.com/tc39/proposal-float16array
121-
"Float16Array",
122-
// Web APIs
123-
"performance",
124-
"Worker",
125-
]
126-
let ignore = Set(skipped + TODO)
127-
128-
for builtin in output.split(separator: ",") where !ignore.contains(String(builtin)) {
129-
XCTAssert(jsEnvironment.builtins.contains(String(builtin)),
130-
"Unregistered builtin \(builtin)")
131-
}
132-
}
133-
13476
func convertTypedArrayToHex(_ b: ProgramBuilder, _ array: Variable) -> Variable {
13577
let toHex = b.buildArrowFunction(with: .parameters(n: 1)) { args in
13678
let hex = b.callMethod("toString", on: args[0], withArgs: [b.loadInt(16)])

0 commit comments

Comments
 (0)