- // Check that the canvas is not on the page.
- $web_assert->elementExists('css', '#drupal-off-canvas');
- // Check that response text is on page.
- $web_assert->pageTextContains("Thing $link_index says hello");
- $off_canvas_tray = $this->getOffCanvasDialog();
-
- // Check that tray is visible.
- $this->assertEquals(TRUE, $off_canvas_tray->isVisible());
- $header_text = $off_canvas_tray->find('css', '.ui-dialog-title')->getText();
-
- $tray_text = $off_canvas_tray->findById('drupal-off-canvas')->getText();
- $this->assertEquals("Thing $link_index says hello", $tray_text);
-
- if ($link_index == '2') {
- // Check no title behavior.
- $web_assert->elementExists('css', '.ui-dialog-empty-title');
- $this->assertEquals("\xc2\xa0", $header_text);
-
- $style = $page->find('css', '.ui-dialog-off-canvas')->getAttribute('style');
- $this->assertTrue(strstr($style, 'width: 555px;') !== FALSE, 'Dialog width respected.');
- $page->clickLink("Click Me 1!");
- $this->waitForOffCanvasToOpen();
- $style = $page->find('css', '.ui-dialog-off-canvas')->getAttribute('style');
- $this->assertTrue(strstr($style, 'width: 555px;') === FALSE, 'Dialog width reset to default.');
- }
- else {
- // Check that header is correct.
- $this->assertEquals("Thing $link_index", $header_text);
- $web_assert->elementNotExists('css', '.ui-dialog-empty-title');
- }
+ $style = $page->find('css', '.ui-dialog-off-canvas')->getAttribute('style');
+ if ($link_index === 1) {
+ $this->assertTrue((bool) strstr($style, 'height: auto;'));
+ }
+ else {
+ $this->assertTrue((bool) strstr($style, 'height: 421px;'));