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

Side by Side Diff: content/browser/service_worker/service_worker_browsertest.cc

Issue 2408393003: Manage insecure content flags in SSLManager, not WebContentsImpl (Closed)
Patch Set: fix test failure Created 4 years, 2 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <stdint.h> 6 #include <stdint.h>
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 1369 matching lines...) Expand 10 before | Expand all | Expand 10 after
1380 public_context()->RegisterServiceWorker( 1380 public_context()->RegisterServiceWorker(
1381 https_server.GetURL(kPageUrl), 1381 https_server.GetURL(kPageUrl),
1382 https_server.GetURL(kWorkerUrl), 1382 https_server.GetURL(kWorkerUrl),
1383 base::Bind(&ExpectResultAndRun, true, base::Bind(&base::DoNothing))); 1383 base::Bind(&ExpectResultAndRun, true, base::Bind(&base::DoNothing)));
1384 observer->Wait(); 1384 observer->Wait();
1385 1385
1386 const base::string16 title = base::ASCIIToUTF16("Title"); 1386 const base::string16 title = base::ASCIIToUTF16("Title");
1387 TitleWatcher title_watcher(shell()->web_contents(), title); 1387 TitleWatcher title_watcher(shell()->web_contents(), title);
1388 NavigateToURL(shell(), https_server.GetURL(kPageUrl)); 1388 NavigateToURL(shell(), https_server.GetURL(kPageUrl));
1389 EXPECT_EQ(title, title_watcher.WaitAndGetTitle()); 1389 EXPECT_EQ(title, title_watcher.WaitAndGetTitle());
1390 EXPECT_FALSE(static_cast<WebContentsImpl*>(shell()->web_contents())
1391 ->DisplayedInsecureContent());
1392 NavigationEntry* entry = 1390 NavigationEntry* entry =
1393 shell()->web_contents()->GetController().GetVisibleEntry(); 1391 shell()->web_contents()->GetController().GetVisibleEntry();
1394 EXPECT_TRUE(entry->GetSSL().initialized); 1392 EXPECT_TRUE(entry->GetSSL().initialized);
1393 EXPECT_FALSE(!!(entry->GetSSL().content_status &
1394 SSLStatus::DISPLAYED_INSECURE_CONTENT));
1395 EXPECT_TRUE( 1395 EXPECT_TRUE(
1396 https_server.GetCertificate()->Equals(entry->GetSSL().certificate.get())); 1396 https_server.GetCertificate()->Equals(entry->GetSSL().certificate.get()));
1397 EXPECT_EQ(0u, entry->GetSSL().cert_status); 1397 EXPECT_EQ(0u, entry->GetSSL().cert_status);
1398 1398
1399 shell()->Close(); 1399 shell()->Close();
1400 1400
1401 base::RunLoop run_loop; 1401 base::RunLoop run_loop;
1402 public_context()->UnregisterServiceWorker( 1402 public_context()->UnregisterServiceWorker(
1403 https_server.GetURL(kPageUrl), 1403 https_server.GetURL(kPageUrl),
1404 base::Bind(&ExpectResultAndRun, true, run_loop.QuitClosure())); 1404 base::Bind(&ExpectResultAndRun, true, run_loop.QuitClosure()));
(...skipping 10 matching lines...) Expand all
1415 public_context()->RegisterServiceWorker( 1415 public_context()->RegisterServiceWorker(
1416 embedded_test_server()->GetURL(kPageUrl), 1416 embedded_test_server()->GetURL(kPageUrl),
1417 embedded_test_server()->GetURL(kWorkerUrl), 1417 embedded_test_server()->GetURL(kWorkerUrl),
1418 base::Bind(&ExpectResultAndRun, true, base::Bind(&base::DoNothing))); 1418 base::Bind(&ExpectResultAndRun, true, base::Bind(&base::DoNothing)));
1419 observer->Wait(); 1419 observer->Wait();
1420 1420
1421 const base::string16 title = base::ASCIIToUTF16("Title"); 1421 const base::string16 title = base::ASCIIToUTF16("Title");
1422 TitleWatcher title_watcher(shell()->web_contents(), title); 1422 TitleWatcher title_watcher(shell()->web_contents(), title);
1423 NavigateToURL(shell(), embedded_test_server()->GetURL(kPageUrl)); 1423 NavigateToURL(shell(), embedded_test_server()->GetURL(kPageUrl));
1424 EXPECT_EQ(title, title_watcher.WaitAndGetTitle()); 1424 EXPECT_EQ(title, title_watcher.WaitAndGetTitle());
1425 EXPECT_FALSE(static_cast<WebContentsImpl*>(shell()->web_contents())
1426 ->DisplayedInsecureContent());
1427 NavigationEntry* entry = 1425 NavigationEntry* entry =
1428 shell()->web_contents()->GetController().GetVisibleEntry(); 1426 shell()->web_contents()->GetController().GetVisibleEntry();
1429 EXPECT_TRUE(entry->GetSSL().initialized); 1427 EXPECT_TRUE(entry->GetSSL().initialized);
1428 EXPECT_FALSE(!!(entry->GetSSL().content_status &
1429 SSLStatus::DISPLAYED_INSECURE_CONTENT));
1430 EXPECT_FALSE(entry->GetSSL().certificate); 1430 EXPECT_FALSE(entry->GetSSL().certificate);
1431 1431
1432 shell()->Close(); 1432 shell()->Close();
1433 1433
1434 base::RunLoop run_loop; 1434 base::RunLoop run_loop;
1435 public_context()->UnregisterServiceWorker( 1435 public_context()->UnregisterServiceWorker(
1436 embedded_test_server()->GetURL(kPageUrl), 1436 embedded_test_server()->GetURL(kPageUrl),
1437 base::Bind(&ExpectResultAndRun, true, run_loop.QuitClosure())); 1437 base::Bind(&ExpectResultAndRun, true, run_loop.QuitClosure()));
1438 run_loop.Run(); 1438 run_loop.Run();
1439 } 1439 }
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
2068 ServiceWorkerV8CacheStrategiesNormalTest, 2068 ServiceWorkerV8CacheStrategiesNormalTest,
2069 ::testing::Values(true, false)); 2069 ::testing::Values(true, false));
2070 INSTANTIATE_TEST_CASE_P(ServiceWorkerBrowserTest, 2070 INSTANTIATE_TEST_CASE_P(ServiceWorkerBrowserTest,
2071 ServiceWorkerV8CacheStrategiesAggressiveTest, 2071 ServiceWorkerV8CacheStrategiesAggressiveTest,
2072 ::testing::Values(true, false)); 2072 ::testing::Values(true, false));
2073 INSTANTIATE_TEST_CASE_P(ServiceWorkerBrowserTest, 2073 INSTANTIATE_TEST_CASE_P(ServiceWorkerBrowserTest,
2074 ServiceWorkerDisableWebSecurityTest, 2074 ServiceWorkerDisableWebSecurityTest,
2075 ::testing::Values(true, false)); 2075 ::testing::Values(true, false));
2076 2076
2077 } // namespace content 2077 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/site_per_process_browsertest.cc » ('j') | content/browser/ssl/ssl_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698