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/path_service.h" | 6 #include "base/path_service.h" |
7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 1273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1284 | 1284 |
1285 // | 1285 // |
1286 // Frame navigation | 1286 // Frame navigation |
1287 // | 1287 // |
1288 | 1288 |
1289 // From a good HTTPS top frame: | 1289 // From a good HTTPS top frame: |
1290 // - navigate to an OK HTTPS frame | 1290 // - navigate to an OK HTTPS frame |
1291 // - navigate to a bad HTTPS (expect unsafe content and filtered frame), then | 1291 // - navigate to a bad HTTPS (expect unsafe content and filtered frame), then |
1292 // back | 1292 // back |
1293 // - navigate to HTTP (expect insecure content), then back | 1293 // - navigate to HTTP (expect insecure content), then back |
1294 IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_TestGoodFrameNavigation) { | 1294 IN_PROC_BROWSER_TEST_F(SSLUITest, TestGoodFrameNavigation) { |
1295 ASSERT_TRUE(test_server()->Start()); | 1295 ASSERT_TRUE(test_server()->Start()); |
1296 ASSERT_TRUE(https_server_.Start()); | 1296 ASSERT_TRUE(https_server_.Start()); |
1297 ASSERT_TRUE(https_server_expired_.Start()); | 1297 ASSERT_TRUE(https_server_expired_.Start()); |
1298 | 1298 |
1299 std::string top_frame_path; | 1299 std::string top_frame_path; |
1300 ASSERT_TRUE(GetTopFramePath(*test_server(), | 1300 ASSERT_TRUE(GetTopFramePath(*test_server(), |
1301 https_server_, | 1301 https_server_, |
1302 https_server_expired_, | 1302 https_server_expired_, |
1303 &top_frame_path)); | 1303 &top_frame_path)); |
1304 | 1304 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1369 content::NOTIFICATION_LOAD_STOP, | 1369 content::NOTIFICATION_LOAD_STOP, |
1370 content::Source<NavigationController>(&tab->GetController())); | 1370 content::Source<NavigationController>(&tab->GetController())); |
1371 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( | 1371 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( |
1372 tab, | 1372 tab, |
1373 "window.domAutomationController.send(clickLink('HTTPLink'));", | 1373 "window.domAutomationController.send(clickLink('HTTPLink'));", |
1374 &success)); | 1374 &success)); |
1375 ASSERT_TRUE(success); | 1375 ASSERT_TRUE(success); |
1376 observer.Wait(); | 1376 observer.Wait(); |
1377 } | 1377 } |
1378 | 1378 |
1379 // Our state should be insecure. | 1379 // Our state should be unathenticated (in the ran mixed script sense) |
1380 CheckAuthenticatedState(tab, true); | 1380 CheckUnauthenticatedState(tab); |
Lei Zhang
2013/05/29 20:06:34
How does this compile correctly when CheckAuthenti
| |
1381 | 1381 |
1382 // Go back, our state should be unchanged. | 1382 // Go back, our state should be unchanged. |
1383 { | 1383 { |
1384 content::WindowedNotificationObserver observer( | 1384 content::WindowedNotificationObserver observer( |
1385 content::NOTIFICATION_LOAD_STOP, | 1385 content::NOTIFICATION_LOAD_STOP, |
1386 content::Source<NavigationController>(&tab->GetController())); | 1386 content::Source<NavigationController>(&tab->GetController())); |
1387 tab->GetController().GoBack(); | 1387 tab->GetController().GoBack(); |
1388 observer.Wait(); | 1388 observer.Wait(); |
1389 } | 1389 } |
1390 CheckAuthenticatedState(tab, true); | 1390 CheckUnauthenticatedState(tab); |
1391 } | 1391 } |
1392 | 1392 |
1393 // From a bad HTTPS top frame: | 1393 // From a bad HTTPS top frame: |
1394 // - navigate to an OK HTTPS frame (expected to be still authentication broken). | 1394 // - navigate to an OK HTTPS frame (expected to be still authentication broken). |
1395 IN_PROC_BROWSER_TEST_F(SSLUITest, TestBadFrameNavigation) { | 1395 IN_PROC_BROWSER_TEST_F(SSLUITest, TestBadFrameNavigation) { |
1396 ASSERT_TRUE(https_server_.Start()); | 1396 ASSERT_TRUE(https_server_.Start()); |
1397 ASSERT_TRUE(https_server_expired_.Start()); | 1397 ASSERT_TRUE(https_server_expired_.Start()); |
1398 | 1398 |
1399 std::string top_frame_path; | 1399 std::string top_frame_path; |
1400 ASSERT_TRUE(GetTopFramePath(*test_server(), | 1400 ASSERT_TRUE(GetTopFramePath(*test_server(), |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1632 | 1632 |
1633 // Visit a page over https that contains a frame with a redirect. | 1633 // Visit a page over https that contains a frame with a redirect. |
1634 | 1634 |
1635 // XMLHttpRequest insecure content in synchronous mode. | 1635 // XMLHttpRequest insecure content in synchronous mode. |
1636 | 1636 |
1637 // XMLHttpRequest insecure content in asynchronous mode. | 1637 // XMLHttpRequest insecure content in asynchronous mode. |
1638 | 1638 |
1639 // XMLHttpRequest over bad ssl in synchronous mode. | 1639 // XMLHttpRequest over bad ssl in synchronous mode. |
1640 | 1640 |
1641 // XMLHttpRequest over OK ssl in synchronous mode. | 1641 // XMLHttpRequest over OK ssl in synchronous mode. |
OLD | NEW |