summaryrefslogtreecommitdiff
path: root/test/smoke-tests
diff options
context:
space:
mode:
authorMatt Watson <mattdangerw@gmail.com>2013-06-03 11:09:54 -0700
committerMatt Watson <mattdangerw@gmail.com>2013-06-12 12:28:59 -0700
commit9231460b3960e703a10da458f7020de51022004d (patch)
tree7cb412108d4cb7893f215a7f42c9b5f8c82661ba /test/smoke-tests
parent265f791d107f141213c2cf66d38dfc541f065702 (diff)
No background animation switching between pages with same background
When background URI is changes for the currently visible page, it will switch backgrounds without a transition animation. [endlessm/eos-sdk#88]
Diffstat (limited to 'test/smoke-tests')
-rw-r--r--test/smoke-tests/app-window.js17
1 files changed, 15 insertions, 2 deletions
diff --git a/test/smoke-tests/app-window.js b/test/smoke-tests/app-window.js
index ac0907b..e05ae5a 100644
--- a/test/smoke-tests/app-window.js
+++ b/test/smoke-tests/app-window.js
@@ -7,6 +7,8 @@ const GObject = imports.gi.GObject;
const TEST_APPLICATION_ID = 'com.endlessm.example.test';
+const CAT_BACKGROUND_PATH = './test/smoke-tests/images/cat_eye.jpg';
+const DOG_BACKGROUND_PATH = './test/smoke-tests/images/dog_eye.jpg';
const Page0 = new Lang.Class ({
Name: 'Page0',
@@ -78,6 +80,8 @@ const Page1 = new Lang.Class ({
this.add(this.button1);
this.button2 = new Gtk.Button({ label: 'Go to page named "page0"' });
this.add(this.button2);
+ this.button3 = new Gtk.Button({ label: 'Swap this page background' });
+ this.add(this.button3);
}
});
@@ -130,6 +134,15 @@ const TestApplication = new Lang.Class ({
this._page1.button2.connect('clicked', Lang.bind(this, function () {
this._pm.visible_page_name = "page0";
}));
+ this._page1.button3.connect('clicked', Lang.bind(this, function () {
+ let background_uri = this._pm.get_page_background_uri(this._page1);
+ if (background_uri === CAT_BACKGROUND_PATH)
+ background_uri = DOG_BACKGROUND_PATH;
+ else
+ background_uri = CAT_BACKGROUND_PATH;
+ this._pm.set_page_background_uri(this._page1, background_uri);
+ }));
+
this._toolbox = new Toolbox();
this._toolbox.switch1.connect('notify::active', Lang.bind(this, function () {
@@ -143,12 +156,12 @@ const TestApplication = new Lang.Class ({
this._pm.add(this._page0, {
name: "page0",
- background_uri: "./test/smoke-tests/images/cat_eye.jpg",
+ background_uri: CAT_BACKGROUND_PATH,
custom_toolbox_widget: this._toolbox
});
this._pm.add(this._page1, {
name: "page1",
- background_uri: "./test/smoke-tests/images/dog_eye.jpg",
+ background_uri: DOG_BACKGROUND_PATH,
custom_toolbox_widget: this._toolbox,
page_actions: true
});