2012-03-12 19:03:45 -07:00
|
|
|
/* Any copyright is dedicated to the Public Domain.
|
|
|
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
|
|
|
|
|
|
function runTests() {
|
2012-07-07 02:55:06 -07:00
|
|
|
yield setLinks("0,1,2,3,4,5,6,7,8");
|
2012-03-12 19:03:45 -07:00
|
|
|
setPinnedLinks("");
|
|
|
|
|
|
|
|
yield addNewTabPageTab();
|
|
|
|
checkGrid("0,1,2,3,4,5,6,7,8");
|
|
|
|
|
2012-03-27 03:02:55 -07:00
|
|
|
let cell = getCell(0).node;
|
2012-03-12 19:03:45 -07:00
|
|
|
|
2012-07-07 02:55:06 -07:00
|
|
|
sendDragEvent("drop", cell, "http://example.com/#99\nblank");
|
|
|
|
is(NewTabUtils.pinnedLinks.links[0].url, "http://example.com/#99",
|
2012-03-12 19:03:45 -07:00
|
|
|
"first cell is pinned and contains the dropped site");
|
|
|
|
|
|
|
|
yield whenPagesUpdated();
|
|
|
|
checkGrid("99p,0,1,2,3,4,5,6,7");
|
|
|
|
|
2012-03-27 03:02:55 -07:00
|
|
|
sendDragEvent("drop", cell, "");
|
2012-07-07 02:55:06 -07:00
|
|
|
is(NewTabUtils.pinnedLinks.links[0].url, "http://example.com/#99",
|
2012-03-12 19:03:45 -07:00
|
|
|
"first cell is still pinned with the site we dropped before");
|
|
|
|
}
|