OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |