[Activity Log] Enable end to end tests on windows.

Enables most of the test cases on windows. Adds TODOs and bug numbers for those still disabled.


BUG=245594

Review URL: https://chromiumcodereview.appspot.com/23614016

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@223460 0039d316-1c4b-4281-b951-d872f2087c98
parent 84f43c97
...@@ -31,16 +31,9 @@ class ActivityLogApiTest : public ExtensionApiTest { ...@@ -31,16 +31,9 @@ class ActivityLogApiTest : public ExtensionApiTest {
CommandLine saved_cmdline_; CommandLine saved_cmdline_;
}; };
#if defined(OS_WIN)
// TODO(karenlees): test flaky on windows. See Bug: crbug.com/245594
#define MAYBE_TriggerEvent DISABLED_TriggerEvent
#else
#define MAYBE_TriggerEvent TriggerEvent
#endif
// The test extension sends a message to its 'friend'. The test completes // The test extension sends a message to its 'friend'. The test completes
// if it successfully sees the 'friend' receive the message. // if it successfully sees the 'friend' receive the message.
IN_PROC_BROWSER_TEST_F(ActivityLogApiTest, MAYBE_TriggerEvent) { IN_PROC_BROWSER_TEST_F(ActivityLogApiTest, TriggerEvent) {
ActivityLog::GetInstance(profile())->SetWatchdogAppActive(true); ActivityLog::GetInstance(profile())->SetWatchdogAppActive(true);
host_resolver()->AddRule("*", "127.0.0.1"); host_resolver()->AddRule("*", "127.0.0.1");
const Extension* friend_extension = LoadExtensionIncognito( const Extension* friend_extension = LoadExtensionIncognito(
......
...@@ -54,6 +54,34 @@ Adding a new test: ...@@ -54,6 +54,34 @@ Adding a new test:
reply.js. reply.js.
Running a testcase in Incognito mode:
To check logging when run in incognito mode, add the following to the
testcase:
is_incognito: true
This will automatically cause all new tabs to be opened in incognito mode and
check the url information has been correctly cleaned.
Configuring a testcase for a particular OS:
If you need to disable a test for a particular OS then you can do this by
adding the disabled field to the test case. For example:
disabled: {win: true, mac: true}
If you need to configure different expected activity for a particular OS, you
can override the logging. E.g.:
expected_activity_win: ['api.call1', 'api.call2', 'api.call3']
expected_activity_mac: ['api.call1', 'api.call2', 'api.call3']
See the chrome.runtime.getPlatformInfo documentation for details of which OS
names to use.
Running the tests: Running the tests:
> out/Debug/browser_tests --gtest_filter=ActivityLogApiTest.TriggerEvent > out/Debug/browser_tests --gtest_filter=ActivityLogApiTest.TriggerEvent
......
...@@ -84,6 +84,8 @@ testCases.push({ ...@@ -84,6 +84,8 @@ testCases.push({
] ]
}); });
testCases.push({ testCases.push({
// TODO(karenlees): Enable when crbug.com/259079 is fixed.
disabled: {win: true},
func: function triggerTabIds() { func: function triggerTabIds() {
chrome.runtime.sendMessage('pknkgggnfecklokoggaggchhaebkajji', chrome.runtime.sendMessage('pknkgggnfecklokoggaggchhaebkajji',
'tab_ids', function response() { }); 'tab_ids', function response() { });
...@@ -99,6 +101,8 @@ testCases.push({ ...@@ -99,6 +101,8 @@ testCases.push({
] ]
}); });
testCases.push({ testCases.push({
// TODO(karenlees): Enable when crbug.com/259079 is fixed.
disabled: {win: true},
func: function triggerTabIdsIncognito() { func: function triggerTabIdsIncognito() {
chrome.runtime.sendMessage('pknkgggnfecklokoggaggchhaebkajji', chrome.runtime.sendMessage('pknkgggnfecklokoggaggchhaebkajji',
'tab_ids_incognito', function response() { }); 'tab_ids_incognito', function response() { });
...@@ -155,6 +159,21 @@ testCases.push({ ...@@ -155,6 +159,21 @@ testCases.push({
'tabs.onUpdated', 'tabs.onUpdated',
'tabs.onUpdated', 'tabs.onUpdated',
'tabs.remove' 'tabs.remove'
],
// TODO(karenlees): the logging from windows is different.
// Figure out why this is (crbug.com/292252).
expected_activity_win: [
'webRequestInternal.addEventListener',
'webRequestInternal.addEventListener',
'webRequest.onBeforeSendHeaders/1',
'webRequestInternal.eventHandled',
'webRequest.onBeforeSendHeaders',
'webRequest.onBeforeSendHeaders/1',
'webRequestInternal.eventHandled',
'webRequest.onBeforeSendHeaders',
'tabs.onUpdated',
'tabs.onUpdated',
'tabs.remove'
] ]
}); });
...@@ -197,10 +216,23 @@ testCases.push({ ...@@ -197,10 +216,23 @@ testCases.push({
'tabs.onUpdated', 'tabs.onUpdated',
'tabs.onUpdated', 'tabs.onUpdated',
'tabs.remove' 'tabs.remove'
] ],
expected_activity_win: [
'webRequestInternal.addEventListener',
'webRequestInternal.addEventListener',
'windows.create',
'webRequest.onBeforeSendHeaders/3',
'webRequestInternal.eventHandled',
'webRequest.onBeforeSendHeaders',
'tabs.onUpdated',
'tabs.onUpdated',
'tabs.remove'
],
}); });
testCases.push({ testCases.push({
// TODO(karenlees): Enable when crbug.com/259079 is fixed.
disabled: {win: true},
func: function triggerApiCallsOnTabsUpdated() { func: function triggerApiCallsOnTabsUpdated() {
chrome.runtime.sendMessage('pknkgggnfecklokoggaggchhaebkajji', chrome.runtime.sendMessage('pknkgggnfecklokoggaggchhaebkajji',
'api_tab_updated', function response() { }); 'api_tab_updated', function response() { });
...@@ -217,6 +249,8 @@ testCases.push({ ...@@ -217,6 +249,8 @@ testCases.push({
] ]
}); });
testCases.push({ testCases.push({
// TODO(karenlees): Enable when crbug.com/259079 is fixed.
disabled: {win: true},
func: function triggerApiCallsOnTabsUpdatedIncognito() { func: function triggerApiCallsOnTabsUpdatedIncognito() {
chrome.runtime.sendMessage('pknkgggnfecklokoggaggchhaebkajji', chrome.runtime.sendMessage('pknkgggnfecklokoggaggchhaebkajji',
'api_tab_updated_incognito', 'api_tab_updated_incognito',
...@@ -305,6 +339,8 @@ for (var i = 0; i < hookNames.length; i++) { ...@@ -305,6 +339,8 @@ for (var i = 0; i < hookNames.length; i++) {
domExpectedActivity.push('tabs.remove'); domExpectedActivity.push('tabs.remove');
testCases.push({ testCases.push({
// TODO(karenlees): Enable when crbug.com/259079 is fixed.
disabled: {win: true},
func: function triggerDOMChangesOnTabsUpdated() { func: function triggerDOMChangesOnTabsUpdated() {
chrome.runtime.sendMessage('pknkgggnfecklokoggaggchhaebkajji', chrome.runtime.sendMessage('pknkgggnfecklokoggaggchhaebkajji',
'dom_tab_updated', function response() { }); 'dom_tab_updated', function response() { });
...@@ -313,6 +349,8 @@ testCases.push({ ...@@ -313,6 +349,8 @@ testCases.push({
}); });
testCases.push({ testCases.push({
// TODO(karenlees): Enable when crbug.com/259079 is fixed.
disabled: {win: true},
func: function triggerDOMChangesOnTabsUpdated() { func: function triggerDOMChangesOnTabsUpdated() {
chrome.runtime.sendMessage('pknkgggnfecklokoggaggchhaebkajji', chrome.runtime.sendMessage('pknkgggnfecklokoggaggchhaebkajji',
'dom_tab_updated_incognito', 'dom_tab_updated_incognito',
...@@ -489,4 +527,3 @@ function setupTestCasesAndRun() { ...@@ -489,4 +527,3 @@ function setupTestCasesAndRun() {
} }
setupTestCasesAndRun(); setupTestCasesAndRun();
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment