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

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

Issue 2478803003: Remove DOMAutomationController::automation_id_ (Closed)
Patch Set: Rebasing... Created 3 years, 5 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/extensions/browsertest_util.h" 5 #include "chrome/browser/extensions/browsertest_util.h"
6 6
7 #include "base/files/file_util.h" 7 #include "base/files/file_util.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "content/public/test/browser_test_utils.h" 10 #include "content/public/test/browser_test_utils.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 const std::string& extension_id, 44 const std::string& extension_id,
45 const std::string& script) { 45 const std::string& script) {
46 extensions::ProcessManager* manager = 46 extensions::ProcessManager* manager =
47 extensions::ProcessManager::Get(profile); 47 extensions::ProcessManager::Get(profile);
48 extensions::ExtensionHost* host = 48 extensions::ExtensionHost* host =
49 manager->GetBackgroundHostForExtension(extension_id); 49 manager->GetBackgroundHostForExtension(extension_id);
50 if (host == NULL) { 50 if (host == NULL) {
51 ADD_FAILURE() << "Extension " << extension_id << " has no background page."; 51 ADD_FAILURE() << "Extension " << extension_id << " has no background page.";
52 return false; 52 return false;
53 } 53 }
54 return content::ExecuteScript(host->host_contents(), script); 54 content::ExecuteScriptAsync(host->host_contents(), script);
55 return true;
55 } 56 }
56 57
57 void CreateAndInitializeLocalCache() { 58 void CreateAndInitializeLocalCache() {
58 #if defined(OS_CHROMEOS) 59 #if defined(OS_CHROMEOS)
59 base::FilePath extension_cache_dir; 60 base::FilePath extension_cache_dir;
60 CHECK(PathService::Get(chromeos::DIR_DEVICE_EXTENSION_LOCAL_CACHE, 61 CHECK(PathService::Get(chromeos::DIR_DEVICE_EXTENSION_LOCAL_CACHE,
61 &extension_cache_dir)); 62 &extension_cache_dir));
62 base::FilePath cache_init_file = extension_cache_dir.Append( 63 base::FilePath cache_init_file = extension_cache_dir.Append(
63 extensions::LocalExtensionCache::kCacheReadyFlagFileName); 64 extensions::LocalExtensionCache::kCacheReadyFlagFileName);
64 EXPECT_EQ(base::WriteFile(cache_init_file, "", 0), 0); 65 EXPECT_EQ(base::WriteFile(cache_init_file, "", 0), 0);
65 #endif 66 #endif
66 } 67 }
67 68
68 } // namespace browsertest_util 69 } // namespace browsertest_util
69 } // namespace extensions 70 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/wizard_controller_browsertest.cc ('k') | chrome/browser/geolocation/geolocation_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698