forked from playwright-community/playwright-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
objectFactory.go
64 lines (63 loc) · 2.1 KB
/
objectFactory.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package playwright
func createObjectFactory(parent *channelOwner, objectType string, guid string, initializer map[string]interface{}) interface{} {
switch objectType {
case "Android":
return nil
case "Artifact":
return newArtifact(parent, objectType, guid, initializer)
case "BindingCall":
return newBindingCall(parent, objectType, guid, initializer)
case "Browser":
return newBrowser(parent, objectType, guid, initializer)
case "BrowserType":
return newBrowserType(parent, objectType, guid, initializer)
case "BrowserContext":
return newBrowserContext(parent, objectType, guid, initializer)
case "CDPSession":
return newCDPSession(parent, objectType, guid, initializer)
case "ConsoleMessage":
return newConsoleMessage(parent, objectType, guid, initializer)
case "Dialog":
return newDialog(parent, objectType, guid, initializer)
case "ElementHandle":
return newElementHandle(parent, objectType, guid, initializer)
case "Frame":
return newFrame(parent, objectType, guid, initializer)
case "JSHandle":
return newJSHandle(parent, objectType, guid, initializer)
case "LocalUtils":
return nil
case "Tracing":
return newTracing(parent, objectType, guid, initializer)
case "APIRequestContext":
return nil
case "Page":
return newPage(parent, objectType, guid, initializer)
case "Playwright":
return newPlaywright(parent, objectType, guid, initializer)
case "Request":
return newRequest(parent, objectType, guid, initializer)
case "Response":
return newResponse(parent, objectType, guid, initializer)
case "Route":
return newRoute(parent, objectType, guid, initializer)
case "WebSocket":
return newWebsocket(parent, objectType, guid, initializer)
case "Worker":
return newWorker(parent, objectType, guid, initializer)
case "Selectors":
return nil
case "Electron":
return nil
case "FetchRequest":
c := &channelOwner{}
c.createChannelOwner(c, parent, objectType, guid, initializer)
return c
case "JsonPipe":
return newJsonPipe(parent, objectType, guid, initializer)
case "Stream":
return newStream(parent, objectType, guid, initializer)
default:
panic(objectType)
}
}