Chromium Code Reviews| 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 "chrome/common/extensions/extension_builder.h" | 10 #include "chrome/common/extensions/extension_builder.h" |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 24 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 24 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 25 ExtensionApiTest::SetUpCommandLine(command_line); | 25 ExtensionApiTest::SetUpCommandLine(command_line); |
| 26 saved_cmdline_ = *CommandLine::ForCurrentProcess(); | 26 saved_cmdline_ = *CommandLine::ForCurrentProcess(); |
| 27 command_line->AppendSwitch(switches::kEnableExtensionActivityLogging); | 27 command_line->AppendSwitch(switches::kEnableExtensionActivityLogging); |
| 28 } | 28 } |
| 29 | 29 |
| 30 private: | 30 private: |
| 31 CommandLine saved_cmdline_; | 31 CommandLine saved_cmdline_; |
| 32 }; | 32 }; |
| 33 | 33 |
| 34 #if defined(OS_WIN) | |
| 35 // TODO(karenlees): test flaky on windows. See Bug: crbug.com/245594 | |
| 36 #define MAYBE_TriggerEvent DISABLED_TriggerEvent | |
| 37 else | |
|
Bei Zhang
2013/09/17 03:58:07
#else
| |
| 38 #define MAYBE_TriggerEvent TriggerEvent | |
| 39 #endif | |
| 40 | |
| 34 // The test extension sends a message to its 'friend'. The test completes | 41 // The test extension sends a message to its 'friend'. The test completes |
| 35 // if it successfully sees the 'friend' receive the message. | 42 // if it successfully sees the 'friend' receive the message. |
| 36 IN_PROC_BROWSER_TEST_F(ActivityLogApiTest, TriggerEvent) { | 43 IN_PROC_BROWSER_TEST_F(ActivityLogApiTest, MAYBE_TriggerEvent) { |
| 37 ActivityLog::GetInstance(profile())->SetWatchdogAppActive(true); | 44 ActivityLog::GetInstance(profile())->SetWatchdogAppActive(true); |
| 38 host_resolver()->AddRule("*", "127.0.0.1"); | 45 host_resolver()->AddRule("*", "127.0.0.1"); |
| 39 const Extension* friend_extension = LoadExtensionIncognito( | 46 const Extension* friend_extension = LoadExtensionIncognito( |
| 40 test_data_dir_.AppendASCII("activity_log_private/friend")); | 47 test_data_dir_.AppendASCII("activity_log_private/friend")); |
| 41 ASSERT_TRUE(friend_extension); | 48 ASSERT_TRUE(friend_extension); |
| 42 ASSERT_TRUE(RunExtensionTest("activity_log_private/test")); | 49 ASSERT_TRUE(RunExtensionTest("activity_log_private/test")); |
| 43 ActivityLog::GetInstance(profile())->SetWatchdogAppActive(false); | 50 ActivityLog::GetInstance(profile())->SetWatchdogAppActive(false); |
| 44 } | 51 } |
| 45 | 52 |
| 46 } // namespace extensions | 53 } // namespace extensions |
| 47 | 54 |
| OLD | NEW |