cloud/storage/drive: use "name" field as upspin reference.

The previous storage implementation was returning the Google Drive IDs
as Upspin References, which was causing problems and was incorrect. This
change fixes that and adds a rough test asserting that the file is
returned by the list under the same name as it was uploaded.

Closes #579

Change-Id: I0280d91c1f76dd2faec3994b32075c0570c26093
Reviewed-on: https://upspin-review.googlesource.com/18980
Reviewed-by: Andrew Gerrand <adg@golang.org>
diff --git a/cloud/storage/drive/drive.go b/cloud/storage/drive/drive.go
index 9abdd8b..2ecade6 100644
--- a/cloud/storage/drive/drive.go
+++ b/cloud/storage/drive/drive.go
@@ -157,7 +157,7 @@
 
 // List implements storage.Lister.
 func (d *driveImpl) List(token string) (refs []upspin.ListRefsItem, nextToken string, err error) {
-	list := d.files.List().Spaces("appDataFolder").Fields("files(id, quotaBytesUsed)")
+	list := d.files.List().Spaces("appDataFolder").Fields("files(name, quotaBytesUsed)")
 	if token != "" {
 		list = list.PageToken(token)
 	}
@@ -168,7 +168,7 @@
 	refs = make([]upspin.ListRefsItem, len(r.Files))
 	for i, f := range r.Files {
 		refs[i] = upspin.ListRefsItem{
-			Ref:  upspin.Reference(f.Id),
+			Ref:  upspin.Reference(f.Name),
 			Size: f.QuotaBytesUsed,
 		}
 	}
diff --git a/cloud/storage/drive/drive_e2e_test.go b/cloud/storage/drive/drive_e2e_test.go
index 8a6a60a..29f9469 100644
--- a/cloud/storage/drive/drive_e2e_test.go
+++ b/cloud/storage/drive/drive_e2e_test.go
@@ -57,6 +57,16 @@
 	if len(got) == 0 {
 		t.Fatal("expected at least one result")
 	}
+	var found bool
+	for _, f := range got {
+		if string(f.Ref) == fileName {
+			found = true
+			break
+		}
+	}
+	if !found {
+		t.Fatalf("expected %q to be part of the results", fileName)
+	}
 }
 
 func TestDeleteAndDownload(t *testing.T) {