Bug 960426 - Part 6: Fix conflict in browser_dpg_variables-view-filter-03.js. r=past

This commit is contained in:
John Shih 2014-03-27 15:26:47 +08:00
parent 26228f72fd
commit ed742662cc
4 changed files with 25 additions and 27 deletions

View File

@ -64,6 +64,8 @@ function testVariablesAndPropertiesFiltering() {
"There should be 0 variables displayed in the with scope.");
is(functionScope.target.querySelectorAll(".variables-view-variable:not([unmatched])").length, 0,
"There should be 0 variables displayed in the function scope.");
is(globalScope.target.querySelectorAll(".variables-view-variable:not([unmatched])").length, 0,
"There should be 0 variables displayed in the global scope.");
is(localScope.target.querySelectorAll(".variables-view-property:not([unmatched])").length, 0,
"There should be 0 properties displayed in the local scope.");
@ -76,13 +78,11 @@ function testVariablesAndPropertiesFiltering() {
}
function firstFilter() {
typeText(gSearchBox, "*one");
testFiltered("one");
typeText(gSearchBox, "*alpha");
testFiltered("alpha");
isnot(globalScope.target.querySelectorAll(".variables-view-variable:not([unmatched])").length, 0,
"There should be some variables displayed in the global scope.");
is(localScope.target.querySelectorAll(".variables-view-variable:not([unmatched]) > .title > .name")[0].getAttribute("value"),
"one", "The only inner variable displayed should be 'one'");
"alpha", "The only inner variable displayed should be 'alpha'");
}
function secondFilter() {
@ -100,14 +100,12 @@ function testVariablesAndPropertiesFiltering() {
is(globalScope.expanded, false,
"The globalScope should not be expanded.");
backspaceText(gSearchBox, 4);
typeText(gSearchBox, "*two");
testFiltered("two");
backspaceText(gSearchBox, 6);
typeText(gSearchBox, "*beta");
testFiltered("beta");
is(globalScope.target.querySelectorAll(".variables-view-variable:not([unmatched])").length, 0,
"There should be no variables displayed in the global scope.");
is(localScope.target.querySelectorAll(".variables-view-variable:not([unmatched]) > .title > .name")[0].getAttribute("value"),
"two", "The only inner variable displayed should be 'two'");
"beta", "The only inner variable displayed should be 'beta'");
}
firstFilter();

View File

@ -112,14 +112,14 @@ function testVariablesAndPropertiesFiltering() {
"The this reference in localScope should not be expanded.");
is(localScope.target.querySelectorAll(".variables-view-variable:not([unmatched]) > .title > .name")[1].getAttribute("value"),
"one", "The one variable should be visible.");
is(localScope.get("one").expanded, false,
"The one variable in localScope should not be expanded.");
"alpha", "The alpha variable should be visible.");
is(localScope.get("alpha").expanded, false,
"The alpha variable in localScope should not be expanded.");
is(localScope.target.querySelectorAll(".variables-view-variable:not([unmatched]) > .title > .name")[2].getAttribute("value"),
"two", "The two variable should be visible.");
is(localScope.get("two").expanded, false,
"The two variable in localScope should not be expanded.");
"beta", "The beta variable should be visible.");
is(localScope.get("beta").expanded, false,
"The beta variable in localScope should not be expanded.");
is(localScope.target.querySelectorAll(".variables-view-variable:not([unmatched]) > .title > .name")[3].getAttribute("value"),
"__proto__", "The __proto__ reference should be visible.");

View File

@ -63,19 +63,19 @@ function testFirstWithScope() {
ok(withEnums[0].querySelector(".value").className.contains("token-other"),
"Should have the right token class for 'this'.");
is(withEnums[1].querySelector(".name").getAttribute("value"), "one",
"Should have the right property name for 'one'.");
is(withEnums[1].querySelector(".name").getAttribute("value"), "alpha",
"Should have the right property name for 'alpha'.");
is(withEnums[1].querySelector(".value").getAttribute("value"), "1",
"Should have the right property value for 'one'.");
"Should have the right property value for 'alpha'.");
ok(withEnums[1].querySelector(".value").className.contains("token-number"),
"Should have the right token class for 'one'.");
"Should have the right token class for 'alpha'.");
is(withEnums[2].querySelector(".name").getAttribute("value"), "two",
"Should have the right property name for 'two'.");
is(withEnums[2].querySelector(".name").getAttribute("value"), "beta",
"Should have the right property name for 'beta'.");
is(withEnums[2].querySelector(".value").getAttribute("value"), "2",
"Should have the right property value for 'two'.");
"Should have the right property value for 'beta'.");
ok(withEnums[2].querySelector(".value").className.contains("token-number"),
"Should have the right token class for 'two'.");
"Should have the right token class for 'beta'.");
is(withNonEnums[0].querySelector(".name").getAttribute("value"), "__proto__",
"Should have the right property name for '__proto__'.");

View File

@ -13,12 +13,12 @@
<script type="text/javascript">
function test(aNumber) {
var a, obj = { one: 1, two: 2 };
var a, obj = { alpha: 1, beta: 2 };
var r = aNumber;
with (Math) {
a = PI * r * r;
with (obj) {
var foo = two * PI;
var foo = beta * PI;
debugger;
}
}