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

Side by Side Diff: chrome/browser/extensions/api/extension_action/browser_action_apitest.cc

Issue 1225093003: mac: Flush the autorelease pool after making a browser window in browser tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@browser_test_base
Patch Set: Comments from jhawkins, round two. Created 5 years, 5 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
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 "build/build_config.h" 5 #include "build/build_config.h"
6 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" 6 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h"
7 #include "chrome/browser/extensions/browser_action_test_util.h" 7 #include "chrome/browser/extensions/browser_action_test_util.h"
8 #include "chrome/browser/extensions/extension_action.h" 8 #include "chrome/browser/extensions/extension_action.h"
9 #include "chrome/browser/extensions/extension_action_icon_factory.h" 9 #include "chrome/browser/extensions/extension_action_icon_factory.h"
10 #include "chrome/browser/extensions/extension_action_manager.h" 10 #include "chrome/browser/extensions/extension_action_manager.h"
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 kFlagEnableIncognito); 531 kFlagEnableIncognito);
532 ASSERT_TRUE(extension) << message_; 532 ASSERT_TRUE(extension) << message_;
533 533
534 // Open an incognito window. 534 // Open an incognito window.
535 Profile* incognito_profile = browser()->profile()->GetOffTheRecordProfile(); 535 Profile* incognito_profile = browser()->profile()->GetOffTheRecordProfile();
536 Browser* incognito_browser = 536 Browser* incognito_browser =
537 new Browser(Browser::CreateParams(incognito_profile, 537 new Browser(Browser::CreateParams(incognito_profile,
538 browser()->host_desktop_type())); 538 browser()->host_desktop_type()));
539 base::RunLoop().RunUntilIdle(); // Wait for profile initialization. 539 base::RunLoop().RunUntilIdle(); // Wait for profile initialization.
540 // Navigate just to have a tab in this window, otherwise wonky things happen. 540 // Navigate just to have a tab in this window, otherwise wonky things happen.
541 ui_test_utils::OpenURLOffTheRecord(browser()->profile(), GURL("about:blank")); 541 OpenURLOffTheRecord(browser()->profile(), GURL("about:blank"));
542 ASSERT_EQ(1, 542 ASSERT_EQ(1,
543 BrowserActionTestUtil(incognito_browser).NumberOfBrowserActions()); 543 BrowserActionTestUtil(incognito_browser).NumberOfBrowserActions());
544 544
545 // A click in the regular profile should open a tab in the regular profile. 545 // A click in the regular profile should open a tab in the regular profile.
546 ExtensionActionAPI* extension_action_api = 546 ExtensionActionAPI* extension_action_api =
547 ExtensionActionAPI::Get(browser()->profile()); 547 ExtensionActionAPI::Get(browser()->profile());
548 extension_action_api->ExecuteExtensionAction( 548 extension_action_api->ExecuteExtensionAction(
549 extension, browser(), true); 549 extension, browser(), true);
550 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); 550 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message();
551 551
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 const std::string script = 672 const std::string script =
673 "window.domAutomationController.send(document.body.style." 673 "window.domAutomationController.send(document.body.style."
674 "backgroundColor);"; 674 "backgroundColor);";
675 std::string result; 675 std::string result;
676 EXPECT_TRUE(content::ExecuteScriptAndExtractString(tab, script, &result)); 676 EXPECT_TRUE(content::ExecuteScriptAndExtractString(tab, script, &result));
677 EXPECT_EQ(result, "red"); 677 EXPECT_EQ(result, "red");
678 } 678 }
679 679
680 } // namespace 680 } // namespace
681 } // namespace extensions 681 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698