Skip to content

Commit 053645b

Browse files
committed
Review fixes.
1 parent 479e9f9 commit 053645b

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
lines changed

browser/containers/containers_browsertest.cc

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "content/public/browser/storage_partition_config.h"
2626
#include "content/public/test/browser_test.h"
2727
#include "content/public/test/browser_test_utils.h"
28+
#include "content/public/test/test_navigation_observer.h"
2829
#include "net/dns/mock_host_resolver.h"
2930
#include "net/test/embedded_test_server/embedded_test_server.h"
3031
#include "services/network/public/cpp/network_switches.h"
@@ -1202,9 +1203,11 @@ IN_PROC_BROWSER_TEST_F(ContainersBrowserTest, CrossSiteNavigationPersistence) {
12021203
content::EvalJs(web_contents, GetLocalStorageJS("site_b_key")));
12031204

12041205
// Navigate back to site A using browser back
1205-
ASSERT_TRUE(content::ExecJs(web_contents, "window.history.back();",
1206-
content::EXECUTE_SCRIPT_NO_RESOLVE_PROMISES));
1207-
EXPECT_TRUE(content::WaitForLoadStop(web_contents));
1206+
{
1207+
content::TestNavigationObserver nav_observer(web_contents, 1);
1208+
ASSERT_TRUE(content::ExecJs(web_contents, "window.history.back();"));
1209+
nav_observer.Wait();
1210+
}
12081211

12091212
// Verify we're still in the same container
12101213
storage_partition =
@@ -1274,21 +1277,25 @@ IN_PROC_BROWSER_TEST_F(ContainersBrowserTest, NavigationHistoryPersistence) {
12741277
EXPECT_EQ(1, controller.GetCurrentEntryIndex());
12751278

12761279
// Navigate back to page 1
1277-
ASSERT_TRUE(content::ExecJs(web_contents, "window.history.back();",
1278-
content::EXECUTE_SCRIPT_NO_RESOLVE_PROMISES));
1279-
EXPECT_TRUE(content::WaitForLoadStop(web_contents));
1280-
EXPECT_EQ(url_page1, web_contents->GetLastCommittedURL());
1280+
{
1281+
content::TestNavigationObserver nav_observer(web_contents, 1);
1282+
ASSERT_TRUE(content::ExecJs(web_contents, "window.history.back();"));
1283+
nav_observer.Wait();
1284+
EXPECT_EQ(url_page1, web_contents->GetLastCommittedURL());
1285+
}
12811286

12821287
// Verify still in same container
12831288
storage_partition =
12841289
web_contents->GetPrimaryMainFrame()->GetStoragePartition();
12851290
EXPECT_EQ(kTestContainerId, storage_partition->GetConfig().partition_name());
12861291

12871292
// Navigate forward
1288-
ASSERT_TRUE(content::ExecJs(web_contents, "window.history.forward();",
1289-
content::EXECUTE_SCRIPT_NO_RESOLVE_PROMISES));
1290-
EXPECT_TRUE(content::WaitForLoadStop(web_contents));
1291-
EXPECT_EQ(url_page2, web_contents->GetLastCommittedURL());
1293+
{
1294+
content::TestNavigationObserver nav_observer(web_contents, 1);
1295+
ASSERT_TRUE(content::ExecJs(web_contents, "window.history.forward();"));
1296+
nav_observer.Wait();
1297+
EXPECT_EQ(url_page2, web_contents->GetLastCommittedURL());
1298+
}
12921299

12931300
// Verify still in same container
12941301
storage_partition =

chromium_src/components/sessions/content/content_serialized_navigation_driver.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323

2424
#include <components/sessions/content/content_serialized_navigation_driver.cc>
2525

26-
#undef GetSanitizedPageStateForPickle
2726
#undef Sanitize
27+
#undef GetSanitizedPageStateForPickle
2828

2929
namespace sessions {
3030

0 commit comments

Comments
 (0)