OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "chrome/browser/extensions/activity_log/activity_log.h" | 7 #include "chrome/browser/extensions/activity_log/activity_log.h" |
8 #include "chrome/browser/extensions/extension_apitest.h" | 8 #include "chrome/browser/extensions/extension_apitest.h" |
9 #include "chrome/common/chrome_switches.h" | 9 #include "chrome/common/chrome_switches.h" |
10 #include "extensions/common/extension_builder.h" | 10 #include "extensions/common/extension_builder.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 "</head><body>Hello World</body></html>"); | 45 "</head><body>Hello World</body></html>"); |
46 return response.Pass(); | 46 return response.Pass(); |
47 } | 47 } |
48 | 48 |
49 private: | 49 private: |
50 base::CommandLine saved_cmdline_; | 50 base::CommandLine saved_cmdline_; |
51 }; | 51 }; |
52 | 52 |
53 #if defined(OS_WIN) | 53 #if defined(OS_WIN) |
54 // TODO(pmarch): fix flakiness on win debug - http://crbug.com/299393 | 54 // TODO(pmarch): fix flakiness on win debug - http://crbug.com/299393 |
55 #define MAYBE_TriggerEvent DISABLED_TriggerEvent | 55 #define MAYBE_TriggerEvent TriggerEvent |
56 #else | 56 #else |
57 #define MAYBE_TriggerEvent TriggerEvent | 57 #define MAYBE_TriggerEvent TriggerEvent |
58 #endif | 58 #endif |
59 | 59 |
60 // The test extension sends a message to its 'friend'. The test completes | 60 // The test extension sends a message to its 'friend'. The test completes |
61 // if it successfully sees the 'friend' receive the message. | 61 // if it successfully sees the 'friend' receive the message. |
62 IN_PROC_BROWSER_TEST_F(ActivityLogApiTest, MAYBE_TriggerEvent) { | 62 IN_PROC_BROWSER_TEST_F(ActivityLogApiTest, MAYBE_TriggerEvent) { |
63 #if defined(OS_MACOSX) | 63 #if defined(OS_MACOSX) |
64 if (base::mac::IsOSSnowLeopard()) { | 64 if (base::mac::IsOSSnowLeopard()) { |
65 // This test flakes on 10.6 only. http://crbug.com/499176 | 65 // This test flakes on 10.6 only. http://crbug.com/499176 |
66 return; | 66 return; |
67 } | 67 } |
68 #endif | 68 #endif |
69 ActivityLog::GetInstance(profile())->SetWatchdogAppActiveForTesting(true); | 69 ActivityLog::GetInstance(profile())->SetWatchdogAppActiveForTesting(true); |
70 | 70 |
71 host_resolver()->AddRule("*", "127.0.0.1"); | 71 host_resolver()->AddRule("*", "127.0.0.1"); |
72 ASSERT_TRUE(StartEmbeddedTestServer()); | 72 ASSERT_TRUE(StartEmbeddedTestServer()); |
73 embedded_test_server()->RegisterRequestHandler( | 73 embedded_test_server()->RegisterRequestHandler( |
74 base::Bind(&ActivityLogApiTest::HandleRequest, base::Unretained(this))); | 74 base::Bind(&ActivityLogApiTest::HandleRequest, base::Unretained(this))); |
75 | 75 |
76 const Extension* friend_extension = LoadExtensionIncognito( | 76 const Extension* friend_extension = LoadExtensionIncognito( |
77 test_data_dir_.AppendASCII("activity_log_private/friend")); | 77 test_data_dir_.AppendASCII("activity_log_private/friend")); |
78 ASSERT_TRUE(friend_extension); | 78 ASSERT_TRUE(friend_extension); |
79 ASSERT_TRUE(RunExtensionTest("activity_log_private/test")); | 79 ASSERT_TRUE(RunExtensionTest("activity_log_private/test")); |
80 ActivityLog::GetInstance(profile())->SetWatchdogAppActiveForTesting(false); | 80 ActivityLog::GetInstance(profile())->SetWatchdogAppActiveForTesting(false); |
81 } | 81 } |
82 | 82 |
83 } // namespace extensions | 83 } // namespace extensions |
84 | 84 |
OLD | NEW |