Merge pull request #7 from philips/add-track-extension

Add track extension
This commit is contained in:
Brandon Philips 2013-07-02 09:53:22 -07:00
commit c2c4ee6b06
3 changed files with 9 additions and 2 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<request protocol="3.0" version="ChromeOSUpdateEngine-0.1.0.0" updaterversion="ChromeOSUpdateEngine-0.1.0.0" installsource="ondemandupdate" ismachine="1">
<os version="Indy" platform="Chrome OS" sp="ForcedUpdate_x86_64"></os>
<app appid="{87efface-864d-49a5-9bb3-4b050a7c227a}" version="ForcedUpdate" track="" from_track="developer-build" lang="en-US" board="amd64-generic" hardware_class="" delta_okay="false" >
<app appid="{87efface-864d-49a5-9bb3-4b050a7c227a}" version="ForcedUpdate" track="dev-channel" from_track="developer-build" lang="en-US" board="amd64-generic" hardware_class="" delta_okay="false" >
<ping active="1" a="-1" r="-1"></ping>
<updatecheck targetversionprefix=""></updatecheck>
<event eventtype="3" eventresult="2" previousversion=""></event>

View File

@ -77,8 +77,11 @@ type App struct {
Lang string `xml:"lang,attr,omitempty"`
Client string `xml:"client,attr,omitempty"`
InstallAge string `xml:"installage,attr,omitempty"`
FromTrack string `xml:"from_track,attr,omitempty"`
Status string `xml:"status,attr,omitempty"`
// update engine extensions
Track string `xml:"track,attr,omitempty"`
FromTrack string `xml:"from_track,attr,omitempty"`
}
func NewApp(id string) *App {

View File

@ -40,6 +40,10 @@ func TestOmahaRequestUpdateCheck(t *testing.T) {
t.Error("developer-build")
}
if v.Apps[0].Track != "dev-channel" {
t.Error("dev-channel")
}
if v.Apps[0].Events[0].Type != "3" {
t.Error("developer-build")
}