| 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/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/memory/scoped_vector.h" | 6 #include "base/memory/scoped_vector.h" |
| 7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "chrome/browser/extensions/extension_apitest.h" | 9 #include "chrome/browser/extensions/extension_apitest.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 ASSERT_TRUE(test_server()->Start()); | 197 ASSERT_TRUE(test_server()->Start()); |
| 198 | 198 |
| 199 ASSERT_TRUE(LoadExtension( | 199 ASSERT_TRUE(LoadExtension( |
| 200 test_data_dir_.AppendASCII("window_open").AppendASCII("popup_blocking") | 200 test_data_dir_.AppendASCII("window_open").AppendASCII("popup_blocking") |
| 201 .AppendASCII("hosted_app"))); | 201 .AppendASCII("hosted_app"))); |
| 202 | 202 |
| 203 // The app being tested owns the domain a.com . The test URLs we navigate | 203 // The app being tested owns the domain a.com . The test URLs we navigate |
| 204 // to below must be within that domain, so that they fall within the app's | 204 // to below must be within that domain, so that they fall within the app's |
| 205 // web extent. | 205 // web extent. |
| 206 GURL::Replacements replace_host; | 206 GURL::Replacements replace_host; |
| 207 std::string a_dot_com = "a.com"; | 207 replace_host.SetHostStr("a.com"); |
| 208 replace_host.SetHostStr(a_dot_com); | |
| 209 | 208 |
| 210 const std::string popup_app_contents_path( | 209 const std::string popup_app_contents_path( |
| 211 "files/extensions/api_test/window_open/popup_blocking/hosted_app/"); | 210 "files/extensions/api_test/window_open/popup_blocking/hosted_app/"); |
| 212 | 211 |
| 213 GURL open_tab = | 212 GURL open_tab = |
| 214 test_server()->GetURL(popup_app_contents_path + "open_tab.html") | 213 test_server()->GetURL(popup_app_contents_path + "open_tab.html") |
| 215 .ReplaceComponents(replace_host); | 214 .ReplaceComponents(replace_host); |
| 216 GURL open_popup = | 215 GURL open_popup = |
| 217 test_server()->GetURL(popup_app_contents_path + "open_popup.html") | 216 test_server()->GetURL(popup_app_contents_path + "open_popup.html") |
| 218 .ReplaceComponents(replace_host); | 217 .ReplaceComponents(replace_host); |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 last_loaded_extension_id() + "/newtab.html"), | 505 last_loaded_extension_id() + "/newtab.html"), |
| 507 false, | 506 false, |
| 508 &newtab)); | 507 &newtab)); |
| 509 | 508 |
| 510 // Extension API should succeed. | 509 // Extension API should succeed. |
| 511 bool result = false; | 510 bool result = false; |
| 512 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(newtab, "testExtensionApi()", | 511 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(newtab, "testExtensionApi()", |
| 513 &result)); | 512 &result)); |
| 514 EXPECT_TRUE(result); | 513 EXPECT_TRUE(result); |
| 515 } | 514 } |
| OLD | NEW |