| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/ref_counted.h" | 5 #include "base/ref_counted.h" |
| 6 #include "chrome/browser/browser.h" | 6 #include "chrome/browser/browser.h" |
| 7 #include "chrome/browser/browser_list.h" | 7 #include "chrome/browser/browser_list.h" |
| 8 #include "chrome/browser/renderer_host/render_view_host.h" | 8 #include "chrome/browser/renderer_host/render_view_host.h" |
| 9 #include "chrome/browser/extensions/autoupdate_interceptor.h" | 9 #include "chrome/browser/extensions/autoupdate_interceptor.h" |
| 10 #include "chrome/browser/extensions/extension_browsertest.h" | 10 #include "chrome/browser/extensions/extension_browsertest.h" |
| (...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 HTTPTestServer* server = StartHTTPServer(); | 476 HTTPTestServer* server = StartHTTPServer(); |
| 477 // Try a feed that doesn't exist. | 477 // Try a feed that doesn't exist. |
| 478 GetParsedFeedData(server, L"foo.xml", browser(), | 478 GetParsedFeedData(server, L"foo.xml", browser(), |
| 479 "Feed for 'Unknown feed name'", | 479 "Feed for 'Unknown feed name'", |
| 480 "element 'anchor_0' not found", | 480 "element 'anchor_0' not found", |
| 481 "element 'desc_0' not found", | 481 "element 'desc_0' not found", |
| 482 "Not a valid feed."); | 482 "Not a valid feed."); |
| 483 } | 483 } |
| 484 | 484 |
| 485 // Tests that message passing between extensions and tabs works. | 485 // Tests that message passing between extensions and tabs works. |
| 486 IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, MessagingExtensionTab) { | 486 IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, DISABLED_MessagingExtensionTab) { |
| 487 ASSERT_TRUE(LoadExtension( | 487 ASSERT_TRUE(LoadExtension( |
| 488 test_data_dir_.AppendASCII("good").AppendASCII("Extensions") | 488 test_data_dir_.AppendASCII("good").AppendASCII("Extensions") |
| 489 .AppendASCII("bjafgdebaacbbbecmhlhpofkepfkgcpa") | 489 .AppendASCII("bjafgdebaacbbbecmhlhpofkepfkgcpa") |
| 490 .AppendASCII("1.0"))); | 490 .AppendASCII("1.0"))); |
| 491 | 491 |
| 492 // Get the ExtensionHost that is hosting our toolstrip page. | 492 // Get the ExtensionHost that is hosting our toolstrip page. |
| 493 ExtensionProcessManager* manager = | 493 ExtensionProcessManager* manager = |
| 494 browser()->profile()->GetExtensionProcessManager(); | 494 browser()->profile()->GetExtensionProcessManager(); |
| 495 ExtensionHost* host = FindHostWithPath(manager, "/toolstrip.html", 1); | 495 ExtensionHost* host = FindHostWithPath(manager, "/toolstrip.html", 1); |
| 496 | 496 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 browser()->profile()->GetExtensionProcessManager(); | 535 browser()->profile()->GetExtensionProcessManager(); |
| 536 ExtensionHost* host = FindHostWithPath(manager, "/toolstrip.html", 1); | 536 ExtensionHost* host = FindHostWithPath(manager, "/toolstrip.html", 1); |
| 537 | 537 |
| 538 bool result = false; | 538 bool result = false; |
| 539 ui_test_utils::ExecuteJavaScriptAndExtractBool( | 539 ui_test_utils::ExecuteJavaScriptAndExtractBool( |
| 540 host->render_view_host(), L"", L"testLastError()", &result); | 540 host->render_view_host(), L"", L"testLastError()", &result); |
| 541 EXPECT_TRUE(result); | 541 EXPECT_TRUE(result); |
| 542 } | 542 } |
| 543 | 543 |
| 544 // Tests that message passing between extensions and content scripts works. | 544 // Tests that message passing between extensions and content scripts works. |
| 545 IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, MessagingContentScript) { | 545 IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, DISABLED_MessagingContentScript) { |
| 546 HTTPTestServer* server = StartHTTPServer(); | 546 HTTPTestServer* server = StartHTTPServer(); |
| 547 | 547 |
| 548 ASSERT_TRUE(LoadExtension( | 548 ASSERT_TRUE(LoadExtension( |
| 549 test_data_dir_.AppendASCII("good").AppendASCII("Extensions") | 549 test_data_dir_.AppendASCII("good").AppendASCII("Extensions") |
| 550 .AppendASCII("bjafgdebaacbbbecmhlhpofkepfkgcpa") | 550 .AppendASCII("bjafgdebaacbbbecmhlhpofkepfkgcpa") |
| 551 .AppendASCII("1.0"))); | 551 .AppendASCII("1.0"))); |
| 552 | 552 |
| 553 UserScriptMaster* master = browser()->profile()->GetUserScriptMaster(); | 553 UserScriptMaster* master = browser()->profile()->GetUserScriptMaster(); |
| 554 if (!master->ScriptsReady()) { | 554 if (!master->ScriptsReady()) { |
| 555 // Wait for UserScriptMaster to finish its scan. | 555 // Wait for UserScriptMaster to finish its scan. |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 898 | 898 |
| 899 // If the options page hasn't already come up, wait for it. | 899 // If the options page hasn't already come up, wait for it. |
| 900 if (tab_strip->count() == 1) { | 900 if (tab_strip->count() == 1) { |
| 901 ui_test_utils::WaitForNewTab(browser()); | 901 ui_test_utils::WaitForNewTab(browser()); |
| 902 } | 902 } |
| 903 ASSERT_EQ(2, tab_strip->count()); | 903 ASSERT_EQ(2, tab_strip->count()); |
| 904 | 904 |
| 905 EXPECT_EQ(extension->GetResourceURL("options.html"), | 905 EXPECT_EQ(extension->GetResourceURL("options.html"), |
| 906 tab_strip->GetTabContentsAt(1)->GetURL()); | 906 tab_strip->GetTabContentsAt(1)->GetURL()); |
| 907 } | 907 } |
| OLD | NEW |