From 4ac6433a74df2e4b443fa6a314adb3ad4a152d8b Mon Sep 17 00:00:00 2001 From: webchick Date: Tue, 28 Feb 2012 22:11:46 -0800 Subject: Issue #967166 by effulgentsia, Cottser, no_commit_credit, KrisBulman: Fixed Content rendered via AJAX does not respect stylesheets removed in .info files. --- modules/simpletest/tests/ajax.test | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'modules/simpletest/tests/ajax.test') diff --git a/modules/simpletest/tests/ajax.test b/modules/simpletest/tests/ajax.test index 8e731b8e7..014a35042 100644 --- a/modules/simpletest/tests/ajax.test +++ b/modules/simpletest/tests/ajax.test @@ -195,6 +195,27 @@ class AJAXFrameworkTestCase extends AJAXTestCase { $this->assertEqual($new_js, $original_js + array($expected['js'] => 1), t('Page state now has the %js file.', array('%js' => $expected['js']))); $this->assertCommand($commands, array('data' => $expected_js_html), t('Page now has the %js file.', array('%js' => $expected['js']))); } + + /** + * Tests that overridden CSS files are not added during lazy load. + */ + function testLazyLoadOverriddenCSS() { + // The test theme overrides system.base.css without an implementation, + // thereby removing it. + theme_enable(array('test_theme')); + variable_set('theme_default', 'test_theme'); + + // This gets the form, and emulates an Ajax submission on it, including + // adding markup to the HEAD and BODY for any lazy loaded JS/CSS files. + $this->drupalPostAJAX('ajax_forms_test_lazy_load_form', array('add_files' => TRUE), array('op' => t('Submit'))); + + // Verify that the resulting HTML does not load the overridden CSS file. + // We add a "?" to the assertion, because Drupal.settings may include + // information about the file; we only really care about whether it appears + // in a LINK or STYLE tag, for which Drupal always adds a query string for + // cache control. + $this->assertNoText('system.base.css?', 'Ajax lazy loading does not add overridden CSS files.'); + } } /** -- cgit v1.2.3