forked from mtusi2026/mtusi2026lab6
1.6 KiB
1.6 KiB
OO6-LIFECYCLE-1
Source review established that the real browser entrypoint acquired browser/context/page before its protected block, and a RESULT write could prevent close. Existing source357/ZIPc0c132 remain historical. No browser or workload is rerun for this fix.
| Case | Required result |
|---|---|
| Acquired browser, context/page setup rejects | Close the same owned browser exactly once |
| Successful work, result reporting rejects | Close exactly once and preserve the reporting error |
| Work and result reporting both reject | Preserve the work error; report the secondary error separately |
| Work and close reject; secondary reporter also rejects | Preserve the original work error; secondary reporting stays best effort |
| Successful work, close rejects | Fail with the close error and separately report it |
| Acquisition rejects | No nonexistent resource is closed |
| Missing required ports | Reject before acquisition |
| Thrown undefined plus close failure | Preserve that primary thrown value using an explicit failure flag |
| Success | Close once before result reporting, then return the result |
The RED factory extracts the old ordering (acquire → setup/work → result reporting → close). Tests call only this separate factory with mandatory fake ports; the production browser entrypoint is never invoked with optional fakes. The final composition places context/page setup and all business work inside the factory's protected run. The existing lab7 lifecycle contract was read as reference; lab6 has its own implementation and no cross-subject runtime import.