Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: refactor navigation #2881

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from
Draft

Conversation

sadym-chromium
Copy link
Collaborator

@sadym-chromium sadym-chromium commented Dec 10, 2024

Addressing Align navigation with the spec.

Navigation tracker relies on the following events:

  • Page.frameNavigated
  • TargetEvents.FrameStartedNavigating (Network.requestWillBeSent)
  • Page.navigatedWithinDocument
  • Page.frameRequestedNavigation
  • Page.javascriptDialogOpening:beforeunload

@sadym-chromium sadym-chromium added the update-expectations Update WPT expectations label Dec 10, 2024
@sadym-chromium sadym-chromium force-pushed the sadym/refactor-navigation-4 branch from 8a96b32 to 3d6fdd6 Compare December 11, 2024 10:50
@sadym-chromium sadym-chromium force-pushed the sadym/refactor-navigation-4 branch from 6b71d29 to 7f50236 Compare December 11, 2024 13:14
@sadym-chromium sadym-chromium added the puppeteer Run Puppeteer test when added to PR label Dec 11, 2024
@sadym-chromium sadym-chromium added the DO NOT MERGE Don't merge the marked PR label Dec 11, 2024
@sadym-chromium sadym-chromium changed the title [EXPERIMENT] Align navigation with the spec Dec 11, 2024
@sadym-chromium sadym-chromium changed the title Align navigation with the spec [DRAFT] Align navigation with the spec Dec 11, 2024
@sadym-chromium sadym-chromium requested a review from OrKoN December 11, 2024 16:25
@sadym-chromium sadym-chromium removed the DO NOT MERGE Don't merge the marked PR label Dec 11, 2024
@sadym-chromium sadym-chromium changed the title [DRAFT] Align navigation with the spec chore: refactor navigation Dec 11, 2024
}
}

/**
* Keeps track of navigations. Details: http://go/webdriver:bidi-navigation
*/
export class NavigationTracker {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we cover major use cases with unit tests?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added the major cases

@OrKoN
Copy link
Collaborator

OrKoN commented Dec 11, 2024

There are a few new Puppeteer failures as well as far as I can see.

@sadym-chromium sadym-chromium force-pushed the sadym/refactor-navigation-4 branch from a60c5df to ba31234 Compare December 12, 2024 14:56
@sadym-chromium sadym-chromium force-pushed the sadym/refactor-navigation-4 branch from ba31234 to b506b68 Compare December 12, 2024 15:46
}, {
'method': 'browsingContext.navigationStarted',
'params': {
'context': 'stable_0',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the order seems wrong, why is the navigationStarted after domContentLoaded?

Copy link
Collaborator Author

@sadym-chromium sadym-chromium Dec 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

read_sorted_messages sorts messages by methods alphabetically. We could introduce order-persisting helper method, but let's keep it out of scope of this PR



@pytest.mark.asyncio
async def test_aboutBlank_reload_checkEvents(websocket, context_id, html,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's add tests for history updated and fragment navigations in before unload?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

follow-up?



@pytest.mark.asyncio
async def test_aboutBlank_reload_checkEvents(websocket, context_id, html,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's add tests that traverse history causes appropriate events?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
puppeteer Run Puppeteer test when added to PR update-expectations Update WPT expectations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants