Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Side by Side Diff: omaha_request_params_unittest.cc

Issue 4520001: AU: Add test-channel to the list of valid tracks. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git@master
Patch Set: rename test-channel to canary-channel Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « omaha_request_params.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdio.h> 5 #include <stdio.h>
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "gtest/gtest.h" 10 #include "gtest/gtest.h"
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 params.SetTrack("zootrack"); 318 params.SetTrack("zootrack");
319 } 319 }
320 OmahaRequestParams out; 320 OmahaRequestParams out;
321 EXPECT_TRUE(DoTest(&out, "", "")); 321 EXPECT_TRUE(DoTest(&out, "", ""));
322 EXPECT_EQ("arm-generic", out.os_board); 322 EXPECT_EQ("arm-generic", out.os_board);
323 EXPECT_EQ("footrack", out.app_track); 323 EXPECT_EQ("footrack", out.app_track);
324 } 324 }
325 325
326 TEST_F(OmahaRequestDeviceParamsTest, IsValidTrackTest) { 326 TEST_F(OmahaRequestDeviceParamsTest, IsValidTrackTest) {
327 params_.SetBuildTypeOfficial(true); 327 params_.SetBuildTypeOfficial(true);
328 EXPECT_TRUE(params_.IsValidTrack("canary-channel"));
328 EXPECT_TRUE(params_.IsValidTrack("beta-channel")); 329 EXPECT_TRUE(params_.IsValidTrack("beta-channel"));
329 EXPECT_TRUE(params_.IsValidTrack("dev-channel")); 330 EXPECT_TRUE(params_.IsValidTrack("dev-channel"));
330 EXPECT_FALSE(params_.IsValidTrack("some-channel")); 331 EXPECT_FALSE(params_.IsValidTrack("some-channel"));
331 EXPECT_FALSE(params_.IsValidTrack("")); 332 EXPECT_FALSE(params_.IsValidTrack(""));
332 params_.SetBuildTypeOfficial(false); 333 params_.SetBuildTypeOfficial(false);
334 EXPECT_TRUE(params_.IsValidTrack("canary-channel"));
333 EXPECT_TRUE(params_.IsValidTrack("beta-channel")); 335 EXPECT_TRUE(params_.IsValidTrack("beta-channel"));
334 EXPECT_TRUE(params_.IsValidTrack("dev-channel")); 336 EXPECT_TRUE(params_.IsValidTrack("dev-channel"));
335 EXPECT_TRUE(params_.IsValidTrack("some-channel")); 337 EXPECT_TRUE(params_.IsValidTrack("some-channel"));
336 EXPECT_TRUE(params_.IsValidTrack("")); 338 EXPECT_TRUE(params_.IsValidTrack(""));
337 } 339 }
338 340
339 TEST_F(OmahaRequestDeviceParamsTest, InvalidTrackTest) { 341 TEST_F(OmahaRequestDeviceParamsTest, InvalidTrackTest) {
340 ASSERT_TRUE(WriteFileString( 342 ASSERT_TRUE(WriteFileString(
341 kTestDir + "/etc/lsb-release", 343 kTestDir + "/etc/lsb-release",
342 "CHROMEOS_RELEASE_BOARD=arm-generic\n" 344 "CHROMEOS_RELEASE_BOARD=arm-generic\n"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 EXPECT_EQ("{87efface-864d-49a5-9bb3-4b050a7c227a}", out.app_id); 378 EXPECT_EQ("{87efface-864d-49a5-9bb3-4b050a7c227a}", out.app_id);
377 EXPECT_EQ("0.2.2.3", out.app_version); 379 EXPECT_EQ("0.2.2.3", out.app_version);
378 EXPECT_EQ("en-US", out.app_lang); 380 EXPECT_EQ("en-US", out.app_lang);
379 EXPECT_EQ("", out.hardware_class); 381 EXPECT_EQ("", out.hardware_class);
380 EXPECT_TRUE(out.delta_okay); 382 EXPECT_TRUE(out.delta_okay);
381 EXPECT_EQ("dev-channel", out.app_track); 383 EXPECT_EQ("dev-channel", out.app_track);
382 EXPECT_EQ("http://www.google.com", out.update_url); 384 EXPECT_EQ("http://www.google.com", out.update_url);
383 } 385 }
384 386
385 } // namespace chromeos_update_engine 387 } // namespace chromeos_update_engine
OLDNEW
« no previous file with comments | « omaha_request_params.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698