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/file_util.h" | 5 #include "base/file_util.h" |
6 #include "base/memory/ref_counted.h" | 6 #include "base/memory/ref_counted.h" |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/extensions/autoupdate_interceptor.h" | 8 #include "chrome/browser/extensions/autoupdate_interceptor.h" |
9 #include "chrome/browser/extensions/extension_apitest.h" | 9 #include "chrome/browser/extensions/extension_apitest.h" |
10 #include "chrome/browser/extensions/extension_browsertest.h" | 10 #include "chrome/browser/extensions/extension_browsertest.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 const std::string kHashPageB = | 65 const std::string kHashPageB = |
66 "files/extensions/api_test/page_action/hash_change/test_page_B.html"; | 66 "files/extensions/api_test/page_action/hash_change/test_page_B.html"; |
67 | 67 |
68 // Looks for an ExtensionHost whose URL has the given path component (including | 68 // Looks for an ExtensionHost whose URL has the given path component (including |
69 // leading slash). Also verifies that the expected number of hosts are loaded. | 69 // leading slash). Also verifies that the expected number of hosts are loaded. |
70 static ExtensionHost* FindHostWithPath(ExtensionProcessManager* manager, | 70 static ExtensionHost* FindHostWithPath(ExtensionProcessManager* manager, |
71 const std::string& path, | 71 const std::string& path, |
72 int expected_hosts) { | 72 int expected_hosts) { |
73 ExtensionHost* host = NULL; | 73 ExtensionHost* host = NULL; |
74 int num_hosts = 0; | 74 int num_hosts = 0; |
75 for (ExtensionProcessManager::const_iterator iter = manager->begin(); | 75 ExtensionProcessManager::ExtensionHostSet background_hosts = |
76 iter != manager->end(); ++iter) { | 76 manager->background_hosts(); |
| 77 for (ExtensionProcessManager::const_iterator iter = background_hosts.begin(); |
| 78 iter != background_hosts.end(); ++iter) { |
77 if ((*iter)->GetURL().path() == path) { | 79 if ((*iter)->GetURL().path() == path) { |
78 EXPECT_FALSE(host); | 80 EXPECT_FALSE(host); |
79 host = *iter; | 81 host = *iter; |
80 } | 82 } |
81 num_hosts++; | 83 num_hosts++; |
82 } | 84 } |
83 EXPECT_EQ(expected_hosts, num_hosts); | 85 EXPECT_EQ(expected_hosts, num_hosts); |
84 return host; | 86 return host; |
85 } | 87 } |
86 | 88 |
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
924 | 926 |
925 EXPECT_EQ(extension->GetResourceURL("options.html"), | 927 EXPECT_EQ(extension->GetResourceURL("options.html"), |
926 tab_strip->GetTabContentsAt(1)->web_contents()->GetURL()); | 928 tab_strip->GetTabContentsAt(1)->web_contents()->GetURL()); |
927 } | 929 } |
928 | 930 |
929 //============================================================================== | 931 //============================================================================== |
930 // STOP! Please do not add any more random-ass tests here. Create new files for | 932 // STOP! Please do not add any more random-ass tests here. Create new files for |
931 // your tests grouped by functionality. Also, you should strongly consider using | 933 // your tests grouped by functionality. Also, you should strongly consider using |
932 // ExtensionAPITest if possible. | 934 // ExtensionAPITest if possible. |
933 //============================================================================== | 935 //============================================================================== |
OLD | NEW |