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 // |
11 // These tests require write access to HKLM and HKCU. | 11 // These tests require write access to HKLM and HKCU. |
12 // | 12 // |
13 // The "GGLA" brand is used to test the normal code flow of the code, and the | 13 // The "GGLA" brand is used to test the normal code flow of the code, and the |
14 // "TEST" brand is used to test the supplementary brand code code flow. | 14 // "TEST" brand is used to test the supplementary brand code code flow. |
15 | 15 |
16 #include <stddef.h> | 16 #include <stddef.h> |
17 | 17 |
18 #include <memory> | 18 #include <memory> |
19 | 19 |
20 #include "base/logging.h" | 20 #include "base/logging.h" |
| 21 #include "base/message_loop/message_loop.h" |
21 #include "base/posix/eintr_wrapper.h" | 22 #include "base/posix/eintr_wrapper.h" |
22 #include "base/single_thread_task_runner.h" | 23 #include "base/single_thread_task_runner.h" |
23 #include "build/build_config.h" | 24 #include "build/build_config.h" |
24 #include "testing/gmock/include/gmock/gmock.h" | |
25 #include "testing/gtest/include/gtest/gtest.h" | |
26 | |
27 #include "rlz/lib/financial_ping.h" | 25 #include "rlz/lib/financial_ping.h" |
28 #include "rlz/lib/net_response_check.h" | 26 #include "rlz/lib/net_response_check.h" |
29 #include "rlz/lib/rlz_lib.h" | 27 #include "rlz/lib/rlz_lib.h" |
30 #include "rlz/lib/rlz_value_store.h" | 28 #include "rlz/lib/rlz_value_store.h" |
31 #include "rlz/test/rlz_test_helpers.h" | 29 #include "rlz/test/rlz_test_helpers.h" |
| 30 #include "testing/gmock/include/gmock/gmock.h" |
| 31 #include "testing/gtest/include/gtest/gtest.h" |
32 | 32 |
33 #if defined(OS_WIN) | 33 #if defined(OS_WIN) |
34 #include <Windows.h> | 34 #include <Windows.h> |
35 #include "rlz/win/lib/machine_deal.h" | 35 #include "rlz/win/lib/machine_deal.h" |
36 #endif | 36 #endif |
37 | 37 |
38 #if defined(RLZ_NETWORK_IMPLEMENTATION_CHROME_NET) | 38 #if defined(RLZ_NETWORK_IMPLEMENTATION_CHROME_NET) |
39 #include "base/mac/scoped_nsautorelease_pool.h" | 39 #include "base/mac/scoped_nsautorelease_pool.h" |
40 #include "base/threading/thread.h" | 40 #include "base/threading/thread.h" |
41 #include "net/url_request/url_request_test_util.h" | 41 #include "net/url_request/url_request_test_util.h" |
(...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
935 int mkdir_result = mkdir(rlz_lib::testing::RlzStoreFilenameStr().c_str(), | 935 int mkdir_result = mkdir(rlz_lib::testing::RlzStoreFilenameStr().c_str(), |
936 0500); | 936 0500); |
937 ASSERT_EQ(0, mkdir_result); | 937 ASSERT_EQ(0, mkdir_result); |
938 | 938 |
939 rlz_lib::SupplementaryBranding branding("TEST"); | 939 rlz_lib::SupplementaryBranding branding("TEST"); |
940 EXPECT_FALSE(rlz_lib::RecordProductEvent(rlz_lib::TOOLBAR_NOTIFIER, | 940 EXPECT_FALSE(rlz_lib::RecordProductEvent(rlz_lib::TOOLBAR_NOTIFIER, |
941 rlz_lib::IE_DEFAULT_SEARCH, rlz_lib::INSTALL)); | 941 rlz_lib::IE_DEFAULT_SEARCH, rlz_lib::INSTALL)); |
942 } | 942 } |
943 | 943 |
944 #endif | 944 #endif |
OLD | NEW |