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

Side by Side Diff: chrome/browser/rlz/rlz_extension_apitest.cc

Issue 20593003: Move kEnableExperimentalExtensionApis switch to extensions/common/switches.cc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 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 | Annotate | Revision Log
OLDNEW
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 #include <map> 5 #include <map>
6 6
7 #include "chrome/browser/browser_process.h" 7 #include "chrome/browser/browser_process.h"
8 #include "chrome/browser/extensions/extension_apitest.h" 8 #include "chrome/browser/extensions/extension_apitest.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/rlz/rlz_extension_api.h" 11 #include "chrome/browser/rlz/rlz_extension_api.h"
12 #include "chrome/common/chrome_switches.h"
13 #include "chrome/common/extensions/extension.h" 12 #include "chrome/common/extensions/extension.h"
13 #include "extensions/common/switches.h"
14 #include "net/dns/mock_host_resolver.h" 14 #include "net/dns/mock_host_resolver.h"
15 #include "rlz/lib/rlz_lib.h" 15 #include "rlz/lib/rlz_lib.h"
16 16
17 #if (OS_WIN) 17 #if (OS_WIN)
18 #include "base/win/registry.h" 18 #include "base/win/registry.h"
19 #endif 19 #endif
20 20
21 class MockRlzSendFinancialPingFunction : public RlzSendFinancialPingFunction { 21 class MockRlzSendFinancialPingFunction : public RlzSendFinancialPingFunction {
22 public: 22 public:
23 static int expected_count() { 23 static int expected_count() {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_Rlz) { 56 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_Rlz) {
57 // The default test resolver doesn't allow lookups to *.google.com. That 57 // The default test resolver doesn't allow lookups to *.google.com. That
58 // makes sense, but it does make RLZ's SendFinancialPing() fail -- so allow 58 // makes sense, but it does make RLZ's SendFinancialPing() fail -- so allow
59 // connections to google.com in this test. 59 // connections to google.com in this test.
60 scoped_refptr<net::RuleBasedHostResolverProc> resolver = 60 scoped_refptr<net::RuleBasedHostResolverProc> resolver =
61 new net::RuleBasedHostResolverProc(host_resolver()); 61 new net::RuleBasedHostResolverProc(host_resolver());
62 resolver->AllowDirectLookup("*.google.com"); 62 resolver->AllowDirectLookup("*.google.com");
63 net::ScopedDefaultHostResolverProc scoper(resolver); 63 net::ScopedDefaultHostResolverProc scoper(resolver);
64 64
65 CommandLine::ForCurrentProcess()->AppendSwitch( 65 CommandLine::ForCurrentProcess()->AppendSwitch(
66 switches::kEnableExperimentalExtensionApis); 66 extensions::switches::kEnableExperimentalExtensionApis);
67 67
68 // Before running the tests, clear the state of the RLZ products used. 68 // Before running the tests, clear the state of the RLZ products used.
69 rlz_lib::AccessPoint access_points[] = { 69 rlz_lib::AccessPoint access_points[] = {
70 rlz_lib::GD_WEB_SERVER, 70 rlz_lib::GD_WEB_SERVER,
71 rlz_lib::GD_OUTLOOK, 71 rlz_lib::GD_OUTLOOK,
72 rlz_lib::NO_ACCESS_POINT, 72 rlz_lib::NO_ACCESS_POINT,
73 }; 73 };
74 rlz_lib::ClearProductState(rlz_lib::PINYIN_IME, access_points); 74 rlz_lib::ClearProductState(rlz_lib::PINYIN_IME, access_points);
75 rlz_lib::ClearProductState(rlz_lib::DESKTOP, access_points); 75 rlz_lib::ClearProductState(rlz_lib::DESKTOP, access_points);
76 76
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 ASSERT_EQ(1, value); 119 ASSERT_EQ(1, value);
120 120
121 key.Open(HKEY_CURRENT_USER, L"Software\\Google\\Common\\Rlz\\Events\\D", 121 key.Open(HKEY_CURRENT_USER, L"Software\\Google\\Common\\Rlz\\Events\\D",
122 KEY_READ); 122 KEY_READ);
123 ASSERT_FALSE(key.Valid()); 123 ASSERT_FALSE(key.Valid());
124 #endif 124 #endif
125 125
126 // Cleanup. 126 // Cleanup.
127 rlz_lib::ClearProductState(rlz_lib::PINYIN_IME, access_points); 127 rlz_lib::ClearProductState(rlz_lib::PINYIN_IME, access_points);
128 } 128 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698