Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1367627 - Show overlay of grid areas in Grid Highlighter. r=gl
MozReview-Commit-ID: 9KWPltfpWlT
- Loading branch information
Showing
12 changed files
with
260 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
devtools/client/inspector/grids/test/browser_grids_display-setting-show-grid-areas.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,51 @@ | |||
/* Any copyright is dedicated to the Public Domain. | |||
http://creativecommons.org/publicdomain/zero/1.0/ */ | |||
|
|||
"use strict"; | |||
|
|||
// Tests that the 'Display grid areas' grid highlighter setting will update | |||
// the redux store and pref setting. | |||
|
|||
const TEST_URI = ` | |||
<style type='text/css'> | |||
#grid { | |||
display: grid; | |||
} | |||
</style> | |||
<div id="grid"> | |||
<div id="cell1">cell1</div> | |||
<div id="cell2">cell2</div> | |||
</div> | |||
`; | |||
|
|||
const SHOW_GRID_AREAS_PREF = "devtools.gridinspector.showGridAreas"; | |||
|
|||
add_task(function* () { | |||
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI)); | |||
let { inspector, gridInspector } = yield openLayoutView(); | |||
let { document: doc } = gridInspector; | |||
let { store } = inspector; | |||
|
|||
yield selectNode("#grid", inspector); | |||
let checkbox = doc.getElementById("grid-setting-show-grid-areas"); | |||
|
|||
ok(!Services.prefs.getBoolPref(SHOW_GRID_AREAS_PREF), | |||
"'Display grid areas' is pref off by default."); | |||
|
|||
info("Toggling ON the 'Display grid areas' setting."); | |||
let onCheckboxChange = waitUntilState(store, state => | |||
state.highlighterSettings.showGridAreasOverlay); | |||
checkbox.click(); | |||
yield onCheckboxChange; | |||
|
|||
info("Toggling OFF the 'Display grid areas' setting."); | |||
onCheckboxChange = waitUntilState(store, state => | |||
!state.highlighterSettings.showGridAreasOverlay); | |||
checkbox.click(); | |||
yield onCheckboxChange; | |||
|
|||
ok(!Services.prefs.getBoolPref(SHOW_GRID_AREAS_PREF), | |||
"'Display grid areas' is pref off."); | |||
|
|||
Services.prefs.clearUserPref(SHOW_GRID_AREAS_PREF); | |||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.