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 #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_function.h" | 8 #include "chrome/browser/extensions/extension_function.h" |
9 #include "chrome/browser/extensions/extension_function_dispatcher.h" | 9 #include "chrome/browser/extensions/extension_function_dispatcher.h" |
10 #include "chrome/browser/extensions/extension_apitest.h" | 10 #include "chrome/browser/extensions/extension_apitest.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 bool MockRlzSendFinancialPingFunction::RunImpl() { | 39 bool MockRlzSendFinancialPingFunction::RunImpl() { |
40 EXPECT_TRUE(RlzSendFinancialPingFunction::RunImpl()); | 40 EXPECT_TRUE(RlzSendFinancialPingFunction::RunImpl()); |
41 ++expected_count_; | 41 ++expected_count_; |
42 return true; | 42 return true; |
43 } | 43 } |
44 | 44 |
45 ExtensionFunction* MockRlzSendFinancialPingFunctionFactory() { | 45 ExtensionFunction* MockRlzSendFinancialPingFunctionFactory() { |
46 return new MockRlzSendFinancialPingFunction(); | 46 return new MockRlzSendFinancialPingFunction(); |
47 } | 47 } |
48 | 48 |
49 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, Rlz) { | 49 // Mac is flaky - http://crbug.com/137834. |
| 50 #if defined(OS_MACOSX) |
| 51 #define MAYBE_Rlz DISABLED_Rlz |
| 52 #else |
| 53 #define MAYBE_Rlz Rlz |
| 54 #endif |
| 55 |
| 56 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_Rlz) { |
50 // 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 |
51 // 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 |
52 // connections to google.com in this test. | 59 // connections to google.com in this test. |
53 scoped_refptr<net::RuleBasedHostResolverProc> resolver = | 60 scoped_refptr<net::RuleBasedHostResolverProc> resolver = |
54 new net::RuleBasedHostResolverProc(host_resolver()); | 61 new net::RuleBasedHostResolverProc(host_resolver()); |
55 resolver->AllowDirectLookup("*.google.com"); | 62 resolver->AllowDirectLookup("*.google.com"); |
56 net::ScopedDefaultHostResolverProc scoper(resolver); | 63 net::ScopedDefaultHostResolverProc scoper(resolver); |
57 | 64 |
58 CommandLine::ForCurrentProcess()->AppendSwitch( | 65 CommandLine::ForCurrentProcess()->AppendSwitch( |
59 switches::kEnableExperimentalExtensionApis); | 66 switches::kEnableExperimentalExtensionApis); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 ASSERT_EQ(1, value); | 119 ASSERT_EQ(1, value); |
113 | 120 |
114 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", |
115 KEY_READ); | 122 KEY_READ); |
116 ASSERT_FALSE(key.Valid()); | 123 ASSERT_FALSE(key.Valid()); |
117 #endif | 124 #endif |
118 | 125 |
119 // Cleanup. | 126 // Cleanup. |
120 rlz_lib::ClearProductState(rlz_lib::PINYIN_IME, access_points); | 127 rlz_lib::ClearProductState(rlz_lib::PINYIN_IME, access_points); |
121 } | 128 } |
OLD | NEW |