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

Side by Side Diff: chrome/browser/extensions/extension_browsertests_misc.cc

Issue 191010: Attempt at a fix for ExtensionBrowserTest.MessagingContentScript. (Closed)
Patch Set: Created 11 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
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_message_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/extension_browsertest.h" 9 #include "chrome/browser/extensions/extension_browsertest.h"
10 #include "chrome/browser/extensions/extension_host.h" 10 #include "chrome/browser/extensions/extension_host.h"
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 ExtensionHost* host = FindHostWithPath(manager, "/toolstrip.html", 1); 386 ExtensionHost* host = FindHostWithPath(manager, "/toolstrip.html", 1);
387 387
388 bool result = false; 388 bool result = false;
389 ui_test_utils::ExecuteJavaScriptAndExtractBool( 389 ui_test_utils::ExecuteJavaScriptAndExtractBool(
390 host->render_view_host(), L"", L"testLastError()", &result); 390 host->render_view_host(), L"", L"testLastError()", &result);
391 EXPECT_TRUE(result); 391 EXPECT_TRUE(result);
392 } 392 }
393 393
394 #if defined(OS_WIN) // TODO(port) - enable. 394 #if defined(OS_WIN) // TODO(port) - enable.
395 // Tests that message passing between extensions and content scripts works. 395 // Tests that message passing between extensions and content scripts works.
396 IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, DISABLED_MessagingContentScript) { 396 IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, MessagingContentScript) {
397 ASSERT_TRUE(LoadExtension( 397 ASSERT_TRUE(LoadExtension(
398 test_data_dir_.AppendASCII("good").AppendASCII("Extensions") 398 test_data_dir_.AppendASCII("good").AppendASCII("Extensions")
399 .AppendASCII("bjafgdebaacbbbecmhlhpofkepfkgcpa") 399 .AppendASCII("bjafgdebaacbbbecmhlhpofkepfkgcpa")
400 .AppendASCII("1.0"))); 400 .AppendASCII("1.0")));
401 401
402 UserScriptMaster* master = browser()->profile()->GetUserScriptMaster(); 402 UserScriptMaster* master = browser()->profile()->GetUserScriptMaster();
403 if (!master->ScriptsReady()) { 403 if (!master->ScriptsReady()) {
404 // Wait for UserScriptMaster to finish its scan. 404 // Wait for UserScriptMaster to finish its scan.
405 NotificationRegistrar registrar; 405 NotificationRegistrar registrar;
406 registrar.Add(this, NotificationType::USER_SCRIPTS_UPDATED, 406 registrar.Add(this, NotificationType::USER_SCRIPTS_UPDATED,
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 494
495 ExtensionsService* service = browser()->profile()->GetExtensionsService(); 495 ExtensionsService* service = browser()->profile()->GetExtensionsService();
496 EXPECT_EQ(0u, service->extensions()->size()); 496 EXPECT_EQ(0u, service->extensions()->size());
497 ASSERT_EQ(1u, service->disabled_extensions()->size()); 497 ASSERT_EQ(1u, service->disabled_extensions()->size());
498 498
499 // Now try uninstalling it. 499 // Now try uninstalling it.
500 UninstallExtension(service->disabled_extensions()->at(0)->id()); 500 UninstallExtension(service->disabled_extensions()->at(0)->id());
501 EXPECT_EQ(0u, service->extensions()->size()); 501 EXPECT_EQ(0u, service->extensions()->size());
502 EXPECT_EQ(0u, service->disabled_extensions()->size()); 502 EXPECT_EQ(0u, service->disabled_extensions()->size());
503 } 503 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_message_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698