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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/callback.h" | 6 #include "base/callback.h" |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/extensions/api/permissions/permissions_api.h" | 9 #include "chrome/browser/extensions/api/permissions/permissions_api.h" |
10 #include "chrome/browser/extensions/extension_apitest.h" | 10 #include "chrome/browser/extensions/extension_apitest.h" |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 IN_PROC_BROWSER_TEST_F( | 360 IN_PROC_BROWSER_TEST_F( |
361 ExtensionApiTest, | 361 ExtensionApiTest, |
362 DISABLED_ContentScriptStylesInjectedIntoExistingRenderers) { | 362 DISABLED_ContentScriptStylesInjectedIntoExistingRenderers) { |
363 ASSERT_TRUE(StartEmbeddedTestServer()); | 363 ASSERT_TRUE(StartEmbeddedTestServer()); |
364 | 364 |
365 content::WindowedNotificationObserver signal( | 365 content::WindowedNotificationObserver signal( |
366 extensions::NOTIFICATION_USER_SCRIPTS_UPDATED, | 366 extensions::NOTIFICATION_USER_SCRIPTS_UPDATED, |
367 content::Source<Profile>(browser()->profile())); | 367 content::Source<Profile>(browser()->profile())); |
368 | 368 |
369 // Start with a renderer already open at a URL. | 369 // Start with a renderer already open at a URL. |
370 GURL url(test_server()->GetURL("file/extensions/test_file.html")); | 370 GURL url(embedded_test_server()->GetURL("/extensions/test_file.html")); |
371 ui_test_utils::NavigateToURL(browser(), url); | 371 ui_test_utils::NavigateToURL(browser(), url); |
372 | 372 |
373 LoadExtension( | 373 LoadExtension( |
374 test_data_dir_.AppendASCII("content_scripts/existing_renderers")); | 374 test_data_dir_.AppendASCII("content_scripts/existing_renderers")); |
375 | 375 |
376 signal.Wait(); | 376 signal.Wait(); |
377 | 377 |
378 // And check that its styles were affected by the styles that just got loaded. | 378 // And check that its styles were affected by the styles that just got loaded. |
379 bool styles_injected; | 379 bool styles_injected; |
380 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( | 380 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 ExtensionTestMessageListener iframe_loaded_listener("iframe loaded", false); | 627 ExtensionTestMessageListener iframe_loaded_listener("iframe loaded", false); |
628 ExtensionTestMessageListener content_script_listener("script injected", | 628 ExtensionTestMessageListener content_script_listener("script injected", |
629 false); | 629 false); |
630 LoadExtension(data_dir.AppendASCII("script_a_com")); | 630 LoadExtension(data_dir.AppendASCII("script_a_com")); |
631 LoadExtension(data_dir.AppendASCII("background_page_iframe")); | 631 LoadExtension(data_dir.AppendASCII("background_page_iframe")); |
632 iframe_loaded_listener.WaitUntilSatisfied(); | 632 iframe_loaded_listener.WaitUntilSatisfied(); |
633 EXPECT_FALSE(content_script_listener.was_satisfied()); | 633 EXPECT_FALSE(content_script_listener.was_satisfied()); |
634 } | 634 } |
635 | 635 |
636 } // namespace extensions | 636 } // namespace extensions |
OLD | NEW |