Skip to content

Commit 347b912

Browse files
authored
cobalt/testing: Re-Enable SessionHistoryTest (#6884)
This enables the SessionHistoryTest for Android TV. b/437357203 will be used to investigate test failures in other platforms. Test: out/android-x86_devel/bin/run_cobalt_browsertests -v -f \*SessionHistory\* Bug: 437357203
1 parent 4fc306e commit 347b912

File tree

1 file changed

+69
-11
lines changed

1 file changed

+69
-11
lines changed

cobalt/testing/browser_tests/session_history_browsertest.cc

Lines changed: 69 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,12 @@ class SessionHistoryScrollAnchorTest : public SessionHistoryTest {
150150
// If this flakes, use http://crbug.com/61619 on windows and
151151
// http://crbug.com/102094 on mac.
152152
// TODO(b/437357203): Investigate test failure.
153-
IN_PROC_BROWSER_TEST_F(SessionHistoryTest, DISABLED_BasicBackForward) {
153+
#if BUILDFLAG(IS_ANDROIDTV)
154+
#define MAYBE_BasicBackForward BasicBackForward
155+
#else
156+
#define MAYBE_BasicBackForward DISABLED_BasicBackForward
157+
#endif
158+
IN_PROC_BROWSER_TEST_F(SessionHistoryTest, MAYBE_BasicBackForward) {
154159
ASSERT_FALSE(CanGoBack());
155160

156161
ASSERT_NO_FATAL_FAILURE(NavigateAndCheckTitle("bot1.html", "bot1"));
@@ -197,7 +202,12 @@ IN_PROC_BROWSER_TEST_F(SessionHistoryTest, DISABLED_BasicBackForward) {
197202
// Test that back/forward works when navigating in subframes.
198203
// If this flakes, use http://crbug.com/48833
199204
// TODO(b/437357203): Investigate test failure.
200-
IN_PROC_BROWSER_TEST_F(SessionHistoryTest, DISABLED_FrameBackForward) {
205+
#if BUILDFLAG(IS_ANDROIDTV)
206+
#define MAYBE_FrameBackForward FrameBackForward
207+
#else
208+
#define MAYBE_FrameBackForward DISABLED_FrameBackForward
209+
#endif
210+
IN_PROC_BROWSER_TEST_F(SessionHistoryTest, MAYBE_FrameBackForward) {
201211
ASSERT_FALSE(CanGoBack());
202212

203213
ASSERT_NO_FATAL_FAILURE(NavigateAndCheckTitle("frames.html", "bot1"));
@@ -255,7 +265,12 @@ IN_PROC_BROWSER_TEST_F(SessionHistoryTest, DISABLED_FrameBackForward) {
255265
// Test that back/forward preserves POST data and document state in subframes.
256266
// If this flakes use http://crbug.com/61619
257267
// TODO(b/437357203): Investigate test failure.
258-
IN_PROC_BROWSER_TEST_F(SessionHistoryTest, DISABLED_FrameFormBackForward) {
268+
#if BUILDFLAG(IS_ANDROIDTV)
269+
#define MAYBE_FrameFormBackForward FrameFormBackForward
270+
#else
271+
#define MAYBE_FrameFormBackForward DISABLED_FrameFormBackForward
272+
#endif
273+
IN_PROC_BROWSER_TEST_F(SessionHistoryTest, MAYBE_FrameFormBackForward) {
259274
ASSERT_FALSE(CanGoBack());
260275

261276
ASSERT_NO_FATAL_FAILURE(NavigateAndCheckTitle("frames.html", "bot1"));
@@ -303,7 +318,12 @@ IN_PROC_BROWSER_TEST_F(SessionHistoryTest, DISABLED_FrameFormBackForward) {
303318
}
304319

305320
// TODO(b/437357203): Investigate test failure.
306-
IN_PROC_BROWSER_TEST_F(SessionHistoryTest, DISABLED_CrossFrameFormBackForward) {
321+
#if BUILDFLAG(IS_ANDROIDTV)
322+
#define MAYBE_CrossFrameFormBackForward CrossFrameFormBackForward
323+
#else
324+
#define MAYBE_CrossFrameFormBackForward DISABLED_CrossFrameFormBackForward
325+
#endif
326+
IN_PROC_BROWSER_TEST_F(SessionHistoryTest, MAYBE_CrossFrameFormBackForward) {
307327
ASSERT_FALSE(CanGoBack());
308328

309329
GURL frames(GetURL("frames.html"));
@@ -355,7 +375,12 @@ IN_PROC_BROWSER_TEST_F(SessionHistoryTest, DISABLED_CrossFrameFormBackForward) {
355375
// navigations. Bug 730379.
356376
// If this flakes use http://crbug.com/61619.
357377
// TODO(b/437357203): Investigate test failure.
358-
IN_PROC_BROWSER_TEST_F(SessionHistoryTest, DISABLED_FragmentBackForward) {
378+
#if BUILDFLAG(IS_ANDROIDTV)
379+
#define MAYBE_FragmentBackForward FragmentBackForward
380+
#else
381+
#define MAYBE_FragmentBackForward DISABLED_FragmentBackForward
382+
#endif
383+
IN_PROC_BROWSER_TEST_F(SessionHistoryTest, MAYBE_FragmentBackForward) {
359384
ASSERT_FALSE(CanGoBack());
360385

361386
GURL fragment(GetURL("fragment.html"));
@@ -404,7 +429,12 @@ IN_PROC_BROWSER_TEST_F(SessionHistoryTest, DISABLED_FragmentBackForward) {
404429
// TODO(crbug.com/1280512): Flaky on Linux and Lacros.
405430

406431
// TODO(b/437357203): Investigate test failure.
407-
IN_PROC_BROWSER_TEST_F(SessionHistoryTest, DISABLED_JavascriptHistory) {
432+
#if BUILDFLAG(IS_ANDROIDTV)
433+
#define MAYBE_JavascriptHistory JavascriptHistory
434+
#else
435+
#define MAYBE_JavascriptHistory DISABLED_JavascriptHistory
436+
#endif
437+
IN_PROC_BROWSER_TEST_F(SessionHistoryTest, MAYBE_JavascriptHistory) {
408438
ASSERT_FALSE(CanGoBack());
409439

410440
ASSERT_NO_FATAL_FAILURE(NavigateAndCheckTitle("bot1.html", "bot1"));
@@ -470,7 +500,12 @@ IN_PROC_BROWSER_TEST_F(SessionHistoryTest, DISABLED_JavascriptHistory) {
470500
}
471501

472502
// TODO(b/437357203): Investigate test failure.
473-
IN_PROC_BROWSER_TEST_F(SessionHistoryTest, DISABLED_LocationReplace) {
503+
#if BUILDFLAG(IS_ANDROIDTV)
504+
#define MAYBE_LocationReplace LocationReplace
505+
#else
506+
#define MAYBE_LocationReplace DISABLED_LocationReplace
507+
#endif
508+
IN_PROC_BROWSER_TEST_F(SessionHistoryTest, MAYBE_LocationReplace) {
474509
// Test that using location.replace doesn't leave the title of the old page
475510
// visible.
476511
std::u16string expected_title16(u"bot1");
@@ -481,7 +516,12 @@ IN_PROC_BROWSER_TEST_F(SessionHistoryTest, DISABLED_LocationReplace) {
481516
}
482517

483518
// TODO(b/437357203): Investigate test failure.
484-
IN_PROC_BROWSER_TEST_F(SessionHistoryTest, DISABLED_LocationChangeInSubframe) {
519+
#if BUILDFLAG(IS_ANDROIDTV)
520+
#define MAYBE_LocationChangeInSubframe LocationChangeInSubframe
521+
#else
522+
#define MAYBE_LocationChangeInSubframe DISABLED_LocationChangeInSubframe
523+
#endif
524+
IN_PROC_BROWSER_TEST_F(SessionHistoryTest, MAYBE_LocationChangeInSubframe) {
485525
ASSERT_NO_FATAL_FAILURE(
486526
NavigateAndCheckTitle("location_redirect.html", "Default Title"));
487527

@@ -500,8 +540,14 @@ IN_PROC_BROWSER_TEST_F(SessionHistoryTest, DISABLED_LocationChangeInSubframe) {
500540
}
501541

502542
// TODO(b/437357203): Investigate test failure.
543+
#if BUILDFLAG(IS_ANDROIDTV)
544+
#define MAYBE_LocationChangeInSubframe_ScrollAnchorTest LocationChangeInSubframe
545+
#else
546+
#define MAYBE_LocationChangeInSubframe_ScrollAnchorTest \
547+
DISABLED_LocationChangeInSubframe
548+
#endif
503549
IN_PROC_BROWSER_TEST_F(SessionHistoryScrollAnchorTest,
504-
DISABLED_LocationChangeInSubframe) {
550+
MAYBE_LocationChangeInSubframe_ScrollAnchorTest) {
505551
ASSERT_NO_FATAL_FAILURE(
506552
NavigateAndCheckTitle("location_redirect.html", "Default Title"));
507553

@@ -521,7 +567,12 @@ IN_PROC_BROWSER_TEST_F(SessionHistoryScrollAnchorTest,
521567

522568
// http://code.google.com/p/chromium/issues/detail?id=56267
523569
// TODO(b/437357203): Investigate test failure.
524-
IN_PROC_BROWSER_TEST_F(SessionHistoryTest, DISABLED_HistoryLength) {
570+
#if BUILDFLAG(IS_ANDROIDTV)
571+
#define MAYBE_HistoryLength HistoryLength
572+
#else
573+
#define MAYBE_HistoryLength DISABLED_HistoryLength
574+
#endif
575+
IN_PROC_BROWSER_TEST_F(SessionHistoryTest, MAYBE_HistoryLength) {
525576
EXPECT_EQ(1, EvalJs(shell(), "history.length"));
526577
EXPECT_TRUE(
527578
NavigateToURL(shell(), embedded_test_server()->GetURL("/title1.html")));
@@ -552,8 +603,15 @@ IN_PROC_BROWSER_TEST_F(SessionHistoryTest, DISABLED_HistoryLength) {
552603
// uses 307 (rather than 302) redirect to preserve the body of HTTP POST across
553604
// redirects (as mandated by https://tools.ietf.org/html/rfc7231#section-6.4.7).
554605
// TODO(b/437357203): Investigate test failure.
606+
#if BUILDFLAG(IS_ANDROIDTV)
607+
#define MAYBE_GoBackToCrossSitePostWithRedirect \
608+
GoBackToCrossSitePostWithRedirect
609+
#else
610+
#define MAYBE_GoBackToCrossSitePostWithRedirect \
611+
DISABLED_GoBackToCrossSitePostWithRedirect
612+
#endif
555613
IN_PROC_BROWSER_TEST_F(SessionHistoryTest,
556-
DISABLED_GoBackToCrossSitePostWithRedirect) {
614+
MAYBE_GoBackToCrossSitePostWithRedirect) {
557615
GURL form_url(embedded_test_server()->GetURL(
558616
"a.com", "/form_that_posts_cross_site.html"));
559617
GURL redirect_target_url(embedded_test_server()->GetURL("x.com", "/echoall"));

0 commit comments

Comments
 (0)