OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include <map> | 5 #include <map> |
6 | 6 |
7 #include "base/registry.h" | 7 #include "base/win/registry.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/extensions/extension_function.h" | 9 #include "chrome/browser/extensions/extension_function.h" |
10 #include "chrome/browser/extensions/extension_function_dispatcher.h" | 10 #include "chrome/browser/extensions/extension_function_dispatcher.h" |
11 #include "chrome/browser/extensions/extension_apitest.h" | 11 #include "chrome/browser/extensions/extension_apitest.h" |
12 #include "chrome/browser/extensions/extension_rlz_module.h" | 12 #include "chrome/browser/extensions/extension_rlz_module.h" |
13 #include "chrome/common/chrome_switches.h" | 13 #include "chrome/common/chrome_switches.h" |
14 #include "chrome/common/extensions/extension.h" | 14 #include "chrome/common/extensions/extension.h" |
15 #include "rlz/win/lib/rlz_lib.h" | 15 #include "rlz/win/lib/rlz_lib.h" |
16 | 16 |
17 class MockRlzSendFinancialPingFunction : public RlzSendFinancialPingFunction { | 17 class MockRlzSendFinancialPingFunction : public RlzSendFinancialPingFunction { |
(...skipping 26 matching lines...) Expand all Loading... |
44 // Before running the tests, clear the state of the RLZ products used. | 44 // Before running the tests, clear the state of the RLZ products used. |
45 rlz_lib::AccessPoint access_points[] = { | 45 rlz_lib::AccessPoint access_points[] = { |
46 rlz_lib::GD_WEB_SERVER, | 46 rlz_lib::GD_WEB_SERVER, |
47 rlz_lib::GD_OUTLOOK, | 47 rlz_lib::GD_OUTLOOK, |
48 rlz_lib::NO_ACCESS_POINT, | 48 rlz_lib::NO_ACCESS_POINT, |
49 }; | 49 }; |
50 rlz_lib::ClearProductState(rlz_lib::PINYIN_IME, access_points); | 50 rlz_lib::ClearProductState(rlz_lib::PINYIN_IME, access_points); |
51 rlz_lib::ClearProductState(rlz_lib::DESKTOP, access_points); | 51 rlz_lib::ClearProductState(rlz_lib::DESKTOP, access_points); |
52 | 52 |
53 // Check that the state has really been cleared. | 53 // Check that the state has really been cleared. |
54 RegKey key(HKEY_CURRENT_USER, L"Software\\Google\\Common\\Rlz\\Events\\N", | 54 base::win::RegKey key(HKEY_CURRENT_USER, |
55 KEY_READ); | 55 L"Software\\Google\\Common\\Rlz\\Events\\N", |
| 56 KEY_READ); |
56 ASSERT_FALSE(key.Valid()); | 57 ASSERT_FALSE(key.Valid()); |
57 | 58 |
58 key.Open(HKEY_CURRENT_USER, L"Software\\Google\\Common\\Rlz\\Events\\D", | 59 key.Open(HKEY_CURRENT_USER, L"Software\\Google\\Common\\Rlz\\Events\\D", |
59 KEY_READ); | 60 KEY_READ); |
60 ASSERT_FALSE(key.Valid()); | 61 ASSERT_FALSE(key.Valid()); |
61 | 62 |
62 // Mock out experimental.rlz.sendFinancialPing(). | 63 // Mock out experimental.rlz.sendFinancialPing(). |
63 ASSERT_TRUE(ExtensionFunctionDispatcher::OverrideFunction( | 64 ASSERT_TRUE(ExtensionFunctionDispatcher::OverrideFunction( |
64 "experimental.rlz.sendFinancialPing", | 65 "experimental.rlz.sendFinancialPing", |
65 MockRlzSendFinancialPingFunctionFactory)); | 66 MockRlzSendFinancialPingFunctionFactory)); |
(...skipping 24 matching lines...) Expand all Loading... |
90 ASSERT_TRUE(key.ReadValueDW(L"D4I", &value)); | 91 ASSERT_TRUE(key.ReadValueDW(L"D4I", &value)); |
91 ASSERT_EQ(1, value); | 92 ASSERT_EQ(1, value); |
92 | 93 |
93 key.Open(HKEY_CURRENT_USER, L"Software\\Google\\Common\\Rlz\\Events\\D", | 94 key.Open(HKEY_CURRENT_USER, L"Software\\Google\\Common\\Rlz\\Events\\D", |
94 KEY_READ); | 95 KEY_READ); |
95 ASSERT_FALSE(key.Valid()); | 96 ASSERT_FALSE(key.Valid()); |
96 | 97 |
97 // Cleanup. | 98 // Cleanup. |
98 rlz_lib::ClearProductState(rlz_lib::PINYIN_IME, access_points); | 99 rlz_lib::ClearProductState(rlz_lib::PINYIN_IME, access_points); |
99 } | 100 } |
OLD | NEW |