| 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/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" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 RegKey key(HKEY_CURRENT_USER, L"Software\\Google\\Common\\Rlz\\Events\\N", |
| 55 KEY_READ); |
| 55 ASSERT_FALSE(key.Valid()); | 56 ASSERT_FALSE(key.Valid()); |
| 56 | 57 |
| 57 // Mock out experimental.rlz.sendFinancialPing(). | 58 // Mock out experimental.rlz.sendFinancialPing(). |
| 58 ASSERT_TRUE(ExtensionFunctionDispatcher::OverrideFunction( | 59 ASSERT_TRUE(ExtensionFunctionDispatcher::OverrideFunction( |
| 59 "experimental.rlz.sendFinancialPing", | 60 "experimental.rlz.sendFinancialPing", |
| 60 MockRlzSendFinancialPingFunctionFactory)); | 61 MockRlzSendFinancialPingFunctionFactory)); |
| 61 | 62 |
| 62 // Set the access point that the test code is expecting. | 63 // Set the access point that the test code is expecting. |
| 63 ASSERT_TRUE(rlz_lib::SetAccessPointRlz(rlz_lib::GD_DESKBAND, "rlz_apitest")); | 64 ASSERT_TRUE(rlz_lib::SetAccessPointRlz(rlz_lib::GD_DESKBAND, "rlz_apitest")); |
| 64 | 65 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 83 | 84 |
| 84 ASSERT_TRUE(key.ReadValueDW(L"D4I", &value)); | 85 ASSERT_TRUE(key.ReadValueDW(L"D4I", &value)); |
| 85 ASSERT_EQ(1, value); | 86 ASSERT_EQ(1, value); |
| 86 | 87 |
| 87 key.Open(HKEY_CURRENT_USER, L"Software\\Google\\Common\\Rlz\\Events\\D"); | 88 key.Open(HKEY_CURRENT_USER, L"Software\\Google\\Common\\Rlz\\Events\\D"); |
| 88 ASSERT_FALSE(key.Valid()); | 89 ASSERT_FALSE(key.Valid()); |
| 89 | 90 |
| 90 // Cleanup. | 91 // Cleanup. |
| 91 rlz_lib::ClearProductState(rlz_lib::PINYIN_IME, access_points); | 92 rlz_lib::ClearProductState(rlz_lib::PINYIN_IME, access_points); |
| 92 } | 93 } |
| OLD | NEW |