MCPcopy Create free account
hub / github.com/google/gapid / TestSettingDebuggableFlag

Function TestSettingDebuggableFlag

core/os/android/binaryxml/debuggable_test.go:25–49  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

23)
24
25func TestSettingDebuggableFlag(t *testing.T) {
26 assert := assert.To(t)
27 for _, fn := range []string{
28 "testdata/manifest1.binxml",
29 "testdata/manifest2.binxml",
30 "testdata/manifest4.binxml",
31 "testdata/manifest6.binxml",
32 } {
33 originalData, err := ioutil.ReadFile(fn)
34 assert.For("err").ThatError(err).Succeeded()
35
36 tree, err := decodeXmlTree(bytes.NewReader(originalData))
37 assert.For("err").ThatError(err).Succeeded()
38
39 assert.For("xml").ThatString(tree.toXmlString()).DoesNotContain(`android:debuggable="true"`)
40 setManifestApplicationDebuggableAttributeToTrue(tree)
41
42 xmlString := tree.toXmlString()
43 assert.For("xml").ThatString(xmlString).Contains(`android:debuggable="true"`)
44
45 // Make sure we haven't broken the binary representation and that it still parses after the change.
46 _, err = decodeXmlTree(bytes.NewReader(tree.encode()))
47 assert.For("err").ThatError(err).Succeeded()
48 }
49}

Callers

nothing calls this directly

Calls 11

decodeXmlTreeFunction · 0.85
SucceededMethod · 0.80
ThatErrorMethod · 0.80
ForMethod · 0.80
DoesNotContainMethod · 0.80
ThatStringMethod · 0.80
toXmlStringMethod · 0.80
NewReaderMethod · 0.65
ContainsMethod · 0.65
encodeMethod · 0.65

Tested by

no test coverage detected