| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <deque> | 6 #include <deque> |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <unordered_map> | 9 #include <unordered_map> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 3232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3243 // It should never load as the API is suppressed. | 3243 // It should never load as the API is suppressed. |
| 3244 GURL done_url = embedded_test_server()->GetURL("/password/done.html"); | 3244 GURL done_url = embedded_test_server()->GetURL("/password/done.html"); |
| 3245 base::FilePath empty_file = ui_test_utils::GetTestFilePath( | 3245 base::FilePath empty_file = ui_test_utils::GetTestFilePath( |
| 3246 base::FilePath(), base::FilePath(FILE_PATH_LITERAL("empty.html"))); | 3246 base::FilePath(), base::FilePath(FILE_PATH_LITERAL("empty.html"))); |
| 3247 RequestCounter done_counter; | 3247 RequestCounter done_counter; |
| 3248 BrowserThread::PostTask( | 3248 BrowserThread::PostTask( |
| 3249 BrowserThread::IO, FROM_HERE, | 3249 BrowserThread::IO, FROM_HERE, |
| 3250 base::Bind(&CreateCountingInterceptorOnIO, | 3250 base::Bind(&CreateCountingInterceptorOnIO, |
| 3251 done_url, empty_file, done_counter.AsWeakPtr())); | 3251 done_url, empty_file, done_counter.AsWeakPtr())); |
| 3252 // Loading may finish or be interrupted. The final result is important only. | 3252 // Loading may finish or be interrupted. The final result is important only. |
| 3253 // TODO(http://crbug.com/660278): TestPrrenderContents can be created after | |
| 3254 // the JS code runs. The result would be a test timeout. | |
| 3255 DisableLoadEventCheck(); | 3253 DisableLoadEventCheck(); |
| 3254 // TestPrenderContents is always created before the Autosignin JS can run, so |
| 3255 // waiting for PrerenderContents to stop should be reliable. |
| 3256 PrerenderTestURL("/password/autosignin.html", | 3256 PrerenderTestURL("/password/autosignin.html", |
| 3257 FINAL_STATUS_CREDENTIAL_MANAGER_API, 0); | 3257 FINAL_STATUS_CREDENTIAL_MANAGER_API, 0); |
| 3258 EXPECT_EQ(0, done_counter.count()); | 3258 EXPECT_EQ(0, done_counter.count()); |
| 3259 } | 3259 } |
| 3260 | 3260 |
| 3261 class PrerenderIncognitoBrowserTest : public PrerenderBrowserTest { | 3261 class PrerenderIncognitoBrowserTest : public PrerenderBrowserTest { |
| 3262 public: | 3262 public: |
| 3263 void SetUpOnMainThread() override { | 3263 void SetUpOnMainThread() override { |
| 3264 Profile* normal_profile = current_browser()->profile(); | 3264 Profile* normal_profile = current_browser()->profile(); |
| 3265 set_browser(OpenURLOffTheRecord(normal_profile, GURL("about:blank"))); | 3265 set_browser(OpenURLOffTheRecord(normal_profile, GURL("about:blank"))); |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3406 browser()->tab_strip_model()->GetActiveWebContents(); | 3406 browser()->tab_strip_model()->GetActiveWebContents(); |
| 3407 bool display_test_result = false; | 3407 bool display_test_result = false; |
| 3408 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(web_contents, | 3408 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(web_contents, |
| 3409 "DidDisplayReallyPass()", | 3409 "DidDisplayReallyPass()", |
| 3410 &display_test_result)); | 3410 &display_test_result)); |
| 3411 ASSERT_TRUE(display_test_result); | 3411 ASSERT_TRUE(display_test_result); |
| 3412 } | 3412 } |
| 3413 #endif // !defined(DISABLE_NACL) | 3413 #endif // !defined(DISABLE_NACL) |
| 3414 | 3414 |
| 3415 } // namespace prerender | 3415 } // namespace prerender |
| OLD | NEW |