예제 #1
0
파일: mocks.go 프로젝트: 1394/skia-buildbot
// NewMockTileStoreFromJson reads a tile that has been serialized to JSON
// and wraps an instance of MockTileStore around it.
func NewMockTileStoreFromJson(t assert.TestingT, fname string) tiling.TileStore {
	f, err := os.Open(fname)
	assert.Nil(t, err)

	tile, err := types.TileFromJson(f, &types.GoldenTrace{})
	assert.Nil(t, err)

	return &MockTileStore{
		t:    t,
		tile: tile,
	}
}
예제 #2
0
// NewMockTileStoreFromJson reads a tile that has been serialized to JSON
// and wraps an instance of MockTileStore around it.
func NewMockTileBuilderFromJson(t assert.TestingT, fname string) tracedb.MasterTileBuilder {
	f, err := os.Open(fname)
	assert.Nil(t, err)

	tile, err := types.TileFromJson(f, &types.GoldenTrace{})
	assert.Nil(t, err)

	return &MockTileBuilder{
		t:    t,
		tile: tile,
	}
}