Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
feaaa5d7
Unverified
Commit
feaaa5d7
authored
Sep 27, 2019
by
Zachary Anderson
Committed by
GitHub
Sep 27, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tool] Add analytics events for ios-mdns fallback success/failure (#41482)
parent
618fac92
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
devices.dart
packages/flutter_tools/lib/src/ios/devices.dart
+4
-2
devices_test.dart
...es/flutter_tools/test/general.shard/ios/devices_test.dart
+4
-0
No files found.
packages/flutter_tools/lib/src/ios/devices.dart
View file @
feaaa5d7
...
...
@@ -377,7 +377,7 @@ class IOSDevice extends Device {
return
LaunchResult
.
succeeded
(
observatoryUri:
localUri
);
}
}
catch
(
error
)
{
printError
(
'Failed to establish a debug connection with
$id
:
$error
'
);
printError
(
'Failed to establish a debug connection with
$id
using mdns
:
$error
'
);
}
// Fallback to manual protocol discovery.
...
...
@@ -387,13 +387,15 @@ class IOSDevice extends Device {
printTrace
(
'Waiting for observatory port.'
);
localUri
=
await
observatoryDiscovery
.
uri
;
if
(
localUri
!=
null
)
{
UsageEvent
(
'ios-mdns'
,
'fallback-success'
).
send
();
return
LaunchResult
.
succeeded
(
observatoryUri:
localUri
);
}
}
catch
(
error
)
{
printError
(
'Failed to establish a debug connection with
$id
:
$error
'
);
printError
(
'Failed to establish a debug connection with
$id
using logs
:
$error
'
);
}
finally
{
await
observatoryDiscovery
?.
cancel
();
}
UsageEvent
(
'ios-mdns'
,
'fallback-failure'
).
send
();
return
LaunchResult
.
failed
();
}
finally
{
installStatus
.
stop
();
...
...
packages/flutter_tools/test/general.shard/ios/devices_test.dart
View file @
feaaa5d7
...
...
@@ -219,6 +219,7 @@ void main() {
platformArgs:
<
String
,
dynamic
>{},
);
verify
(
mockUsage
.
sendEvent
(
'ios-mdns'
,
'failure'
)).
called
(
1
);
verify
(
mockUsage
.
sendEvent
(
'ios-mdns'
,
'fallback-success'
)).
called
(
1
);
expect
(
launchResult
.
started
,
isTrue
);
expect
(
launchResult
.
hasObservatory
,
isTrue
);
expect
(
await
device
.
stopApp
(
mockApp
),
isFalse
);
...
...
@@ -250,6 +251,8 @@ void main() {
debuggingOptions:
DebuggingOptions
.
enabled
(
const
BuildInfo
(
BuildMode
.
debug
,
null
)),
platformArgs:
<
String
,
dynamic
>{},
);
verify
(
mockUsage
.
sendEvent
(
'ios-mdns'
,
'failure'
)).
called
(
1
);
verify
(
mockUsage
.
sendEvent
(
'ios-mdns'
,
'fallback-failure'
)).
called
(
1
);
expect
(
launchResult
.
started
,
isFalse
);
expect
(
launchResult
.
hasObservatory
,
isFalse
);
},
overrides:
<
Type
,
Generator
>{
...
...
@@ -259,6 +262,7 @@ void main() {
MDnsObservatoryDiscovery:
()
=>
mockMDnsObservatoryDiscovery
,
Platform:
()
=>
macPlatform
,
ProcessManager:
()
=>
mockProcessManager
,
Usage:
()
=>
mockUsage
,
});
testUsingContext
(
' succeeds in release mode'
,
()
async
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment