Tests CSS.setNavigationText method. ==== Initial style sheet text ==== @route --this-page { pathname: "*navigation-queries.html"; } @route --not-this-page { pathname: "*some-other-page.html"; } @function --get-color() { --color: red; @navigation (at: --this-page) { --color: blue; } @navigation (at: --not-this-page) { --color: green; } result: var(--color); } #test { background-color: black; /* TODO(b/431374376): Actually calling a function with a navigation query is currently not implemented. If that is fixed we can just call --get-color() here. */ --actual-color: blue; color: var(--actual-color, --get-color()); } @navigation (at: --this-page) { #test { background-color: yellow; } } @navigation not (at: --this-page) { #test { background-color: gray; } } :root { --background-color: red; color: purple; } Running test: testSimpleEdit ==== Style sheet text ==== @route --this-page { pathname: "*navigation-queries.html"; } @route --not-this-page { pathname: "*some-other-page.html"; } @function --get-color() { --color: red; @navigation (at: --this-page) { --color: blue; } @navigation (at: --not-this-page) { --color: green; } result: var(--color); } #test { background-color: black; /* TODO(b/431374376): Actually calling a function with a navigation query is currently not implemented. If that is fixed we can just call --get-color() here. */ --actual-color: blue; color: var(--actual-color, --get-color()); } @navigation (at: --not-this-page) { #test { background-color: yellow; } } @navigation not (at: --this-page) { #test { background-color: gray; } } :root { --background-color: red; color: purple; } Running test: testInvalidParameters Expected protocol error: Invalid parameters (Failed to deserialize params.range.startLine - BINDINGS: int32 value expected ) Running test: testInvalidText Expected protocol error: SyntaxError Selector or navigation rule text is not valid. Running test: testEditSequentially ==== Style sheet text ==== @route --this-page { pathname: "*navigation-queries.html"; } @route --not-this-page { pathname: "*some-other-page.html"; } @function --get-color() { --color: red; @navigation (at: --this-page) { --color: blue; } @navigation (at: --not-this-page) { --color: green; } result: var(--color); } #test { background-color: black; /* TODO(b/431374376): Actually calling a function with a navigation query is currently not implemented. If that is fixed we can just call --get-color() here. */ --actual-color: blue; color: var(--actual-color, --get-color()); } @navigation (at: --not-this-page) { #test { background-color: yellow; } } @navigation not (at: --this-page) { #test { background-color: gray; } } :root { --background-color: red; color: purple; } ==== Style sheet text ==== @route --this-page { pathname: "*navigation-queries.html"; } @route --not-this-page { pathname: "*some-other-page.html"; } @function --get-color() { --color: red; @navigation (at: --this-page) { --color: blue; } @navigation (at: --not-this-page) { --color: green; } result: var(--color); } #test { background-color: black; /* TODO(b/431374376): Actually calling a function with a navigation query is currently not implemented. If that is fixed we can just call --get-color() here. */ --actual-color: blue; color: var(--actual-color, --get-color()); } @navigation not (at: --not-this-page) { #test { background-color: yellow; } } @navigation not (at: --this-page) { #test { background-color: gray; } } :root { --background-color: red; color: purple; } Running test: testAfterSequentially ==== Style sheet text ==== @route --this-page { pathname: "*navigation-queries.html"; } @route --not-this-page { pathname: "*some-other-page.html"; } @function --get-color() { --color: red; @navigation (at: --this-page) { --color: blue; } @navigation (at: --not-this-page) { --color: green; } result: var(--color); } #test { background-color: black; /* TODO(b/431374376): Actually calling a function with a navigation query is currently not implemented. If that is fixed we can just call --get-color() here. */ --actual-color: blue; color: var(--actual-color, --get-color()); } @navigation not (at: --this-page) { #test { background-color: yellow; } } @navigation not (at: --this-page) { #test { background-color: gray; } } :root { --background-color: red; color: purple; }