| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium 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 // A test application for the RLZ library. | 5 // A test application for the RLZ library. |
| 6 // | 6 // |
| 7 // These tests should not be executed on the build server: | 7 // These tests should not be executed on the build server: |
| 8 // - They assert for the failed cases. | 8 // - They assert for the failed cases. |
| 9 // - They modify machine state (registry). | 9 // - They modify machine state (registry). |
| 10 // | 10 // |
| (...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 831 } | 831 } |
| 832 | 832 |
| 833 EXPECT_TRUE(rlz_lib::GetProductEventsAsCgi(rlz_lib::TOOLBAR_NOTIFIER, | 833 EXPECT_TRUE(rlz_lib::GetProductEventsAsCgi(rlz_lib::TOOLBAR_NOTIFIER, |
| 834 value, 50)); | 834 value, 50)); |
| 835 EXPECT_STREQ("events=I7S", value); | 835 EXPECT_STREQ("events=I7S", value); |
| 836 } | 836 } |
| 837 | 837 |
| 838 #if defined(OS_POSIX) | 838 #if defined(OS_POSIX) |
| 839 class ReadonlyRlzDirectoryTest : public RlzLibTestNoMachineState { | 839 class ReadonlyRlzDirectoryTest : public RlzLibTestNoMachineState { |
| 840 protected: | 840 protected: |
| 841 virtual void SetUp() OVERRIDE; | 841 virtual void SetUp() override; |
| 842 }; | 842 }; |
| 843 | 843 |
| 844 void ReadonlyRlzDirectoryTest::SetUp() { | 844 void ReadonlyRlzDirectoryTest::SetUp() { |
| 845 RlzLibTestNoMachineState::SetUp(); | 845 RlzLibTestNoMachineState::SetUp(); |
| 846 // Make the rlz directory non-writeable. | 846 // Make the rlz directory non-writeable. |
| 847 int chmod_result = chmod(temp_dir_.path().value().c_str(), 0500); | 847 int chmod_result = chmod(temp_dir_.path().value().c_str(), 0500); |
| 848 ASSERT_EQ(0, chmod_result); | 848 ASSERT_EQ(0, chmod_result); |
| 849 } | 849 } |
| 850 | 850 |
| 851 TEST_F(ReadonlyRlzDirectoryTest, WriteFails) { | 851 TEST_F(ReadonlyRlzDirectoryTest, WriteFails) { |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 930 int mkdir_result = mkdir(rlz_lib::testing::RlzStoreFilenameStr().c_str(), | 930 int mkdir_result = mkdir(rlz_lib::testing::RlzStoreFilenameStr().c_str(), |
| 931 0500); | 931 0500); |
| 932 ASSERT_EQ(0, mkdir_result); | 932 ASSERT_EQ(0, mkdir_result); |
| 933 | 933 |
| 934 rlz_lib::SupplementaryBranding branding("TEST"); | 934 rlz_lib::SupplementaryBranding branding("TEST"); |
| 935 EXPECT_FALSE(rlz_lib::RecordProductEvent(rlz_lib::TOOLBAR_NOTIFIER, | 935 EXPECT_FALSE(rlz_lib::RecordProductEvent(rlz_lib::TOOLBAR_NOTIFIER, |
| 936 rlz_lib::IE_DEFAULT_SEARCH, rlz_lib::INSTALL)); | 936 rlz_lib::IE_DEFAULT_SEARCH, rlz_lib::INSTALL)); |
| 937 } | 937 } |
| 938 | 938 |
| 939 #endif | 939 #endif |
| OLD | NEW |