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

Side by Side Diff: chrome/browser/extensions/api/web_request/web_request_apitest.cc

Issue 2248873002: Convert WindowOpenDisposition to an enum class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 3 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/macros.h" 6 #include "base/macros.h"
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 ExtensionTestMessageListener listener("ready", false); 535 ExtensionTestMessageListener listener("ready", false);
536 const Extension* extension = 536 const Extension* extension =
537 LoadExtension(test_data_dir_.AppendASCII("webrequest_activetab")); 537 LoadExtension(test_data_dir_.AppendASCII("webrequest_activetab"));
538 ASSERT_TRUE(extension) << message_; 538 ASSERT_TRUE(extension) << message_;
539 EXPECT_TRUE(listener.WaitUntilSatisfied()); 539 EXPECT_TRUE(listener.WaitUntilSatisfied());
540 540
541 // Navigate the browser to a page in a new tab. 541 // Navigate the browser to a page in a new tab.
542 const std::string kHost = "example.com"; 542 const std::string kHost = "example.com";
543 GURL url = embedded_test_server()->GetURL(kHost, "/empty.html"); 543 GURL url = embedded_test_server()->GetURL(kHost, "/empty.html");
544 chrome::NavigateParams params(browser(), url, ui::PAGE_TRANSITION_LINK); 544 chrome::NavigateParams params(browser(), url, ui::PAGE_TRANSITION_LINK);
545 params.disposition = NEW_FOREGROUND_TAB; 545 params.disposition = WindowOpenDisposition::NEW_FOREGROUND_TAB;
546 ui_test_utils::NavigateToURL(&params); 546 ui_test_utils::NavigateToURL(&params);
547 547
548 content::WebContents* web_contents = 548 content::WebContents* web_contents =
549 browser()->tab_strip_model()->GetActiveWebContents(); 549 browser()->tab_strip_model()->GetActiveWebContents();
550 ASSERT_TRUE(web_contents); 550 ASSERT_TRUE(web_contents);
551 ExtensionActionRunner* runner = 551 ExtensionActionRunner* runner =
552 ExtensionActionRunner::GetForWebContents(web_contents); 552 ExtensionActionRunner::GetForWebContents(web_contents);
553 ASSERT_TRUE(runner); 553 ASSERT_TRUE(runner);
554 554
555 int port = embedded_test_server()->port(); 555 int port = embedded_test_server()->port();
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
588 ASSERT_TRUE(granter); 588 ASSERT_TRUE(granter);
589 granter->RevokeForTesting(); 589 granter->RevokeForTesting();
590 base::RunLoop().RunUntilIdle(); 590 base::RunLoop().RunUntilIdle();
591 PerformXhrInPage(web_contents, kHost, port, kXhrPath); 591 PerformXhrInPage(web_contents, kHost, port, kXhrPath);
592 EXPECT_EQ(xhr_count, 592 EXPECT_EQ(xhr_count,
593 GetWebRequestCountFromBackgroundPage(extension, profile())); 593 GetWebRequestCountFromBackgroundPage(extension, profile()));
594 EXPECT_EQ(BLOCKED_ACTION_WEB_REQUEST, runner->GetBlockedActions(extension)); 594 EXPECT_EQ(BLOCKED_ACTION_WEB_REQUEST, runner->GetBlockedActions(extension));
595 } 595 }
596 596
597 } // namespace extensions 597 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/web_navigation/web_navigation_api.cc ('k') | chrome/browser/extensions/app_process_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698