Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Side by Side Diff: chrome/browser/extensions/extension_rlz_apitest.cc

Issue 3172009: Cleanup Registry API: part 3. (Closed) Base URL: git://git.chromium.org/chromium.git
Patch Set: chrome fixes Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/app/breakpad_win.cc ('k') | chrome/browser/importer/firefox_importer_utils_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/app/breakpad_win.cc ('k') | chrome/browser/importer/firefox_importer_utils_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698