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

Enrich Target GCD #7285

Merged
merged 1 commit into from
Jun 20, 2019
Merged

Enrich Target GCD #7285

merged 1 commit into from
Jun 20, 2019

Conversation

dratler
Copy link
Contributor

@dratler dratler commented Jun 12, 2019

Summary :
Enrich DevTools Target API according to Google documentation
Features:

  1. add all Target methods
  2. adopt DevTools with API Spec
  3. Add all Objects
  4. Add More tests for all events
  5. Add copyright to all Classes

1. add all Target methods
2. adopt DevTools with API Spec
3. Add all Objects
4. Add More tests for all events
5. Add copyright to all Classes
@dratler
Copy link
Contributor Author

dratler commented Jun 12, 2019

Hi @shs96c
this PR is related to issue #6667
Also this PR is Behalf of Intuit

Copy link
Member

@shs96c shs96c left a comment

Choose a reason for hiding this comment

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

Thank you for the PR! The only comments I have are nits: there's no reason not to merge this and fix in place. :)

@@ -25,6 +25,7 @@
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Multimap;

import org.openqa.selenium.devtools.target.model.SessionId;
Copy link
Member

Choose a reason for hiding this comment

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

It fills me with endless sadness that we can't use Selenium's own SessionId here.

@@ -57,24 +63,26 @@ public void close() {

public void createSession() {
// Figure out the targets.
Set<Target.TargetInfo> infos = connection.sendAndWait(cdpSession, Target.getTargets(), timeout);
List<TargetInfo> infos = connection.sendAndWait(cdpSession, Target.getTargets(), timeout);
Copy link
Member

Choose a reason for hiding this comment

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

The ordering of targets doesn't matter, and we don't allow duplicates. Set is the right collection type to use.

}

/**
* nject object to the target's main frame that provides a communication channel with browser
Copy link
Member

Choose a reason for hiding this comment

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

Nit: missing first letter.


/**
* Creates a new empty BrowserContext. Similar to an incognito profile but you can have more than
* one.EXPERIMENTAL
Copy link
Member

Choose a reason for hiding this comment

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

Nit: the beta annotation shows that this is experimental.

String url,
Optional<Integer> width,
Optional<Integer> height,
Optional<BrowserContextID> browserContextID,
Copy link
Member

Choose a reason for hiding this comment

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

Nit: BrowserContextId is preferable, and more in keeping with the naming conventions used in selenium.

* automatically detaches from all currently attached targets.EXPERIMENTAL
*/
public static Command<Void> setAutoAttach(
Boolean autoAttach, Boolean waitForDebuggerOnStart, Optional<Boolean> flatten) {
Copy link
Member

Choose a reason for hiding this comment

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

We can clean this up in a later pass, but we can use primitives for parameters that are required. boolean, as we do elsewhere.

@shs96c shs96c merged commit 6c6d811 into SeleniumHQ:master Jun 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants