| OLD | NEW |
| 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 Loading... |
| 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(¶ms); | 546 ui_test_utils::NavigateToURL(¶ms); |
| 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 Loading... |
| 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 |
| OLD | NEW |