Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2900)

Unified Diff: app/surface/transport_dib.h

Issue 661237: This adds in the ability for Chrome to generate windows with snapshots of all... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | app/x11_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: app/surface/transport_dib.h
===================================================================
--- app/surface/transport_dib.h (revision 45523)
+++ app/surface/transport_dib.h (working copy)
@@ -73,6 +73,13 @@
// Returns a default, invalid handle, that is meant to indicate a missing
// Transport DIB.
static Handle DefaultHandleValue() { return NULL; }
+
+ // Returns a value that is ONLY USEFUL FOR TESTS WHERE IT WON'T BE
+ // ACTUALLY USED AS A REAL HANDLE.
+ static Handle GetFakeHandleForTest() {
+ static int fake_handle = 10;
+ return reinterpret_cast<Handle>(fake_handle++);
+ }
#elif defined(OS_MACOSX)
typedef base::SharedMemoryHandle Handle;
// On Mac, the inode number of the backing file is used as an id.
@@ -81,6 +88,13 @@
// Returns a default, invalid handle, that is meant to indicate a missing
// Transport DIB.
static Handle DefaultHandleValue() { return Handle(); }
+
+ // Returns a value that is ONLY USEFUL FOR TESTS WHERE IT WON'T BE
+ // ACTUALLY USED AS A REAL HANDLE.
+ static Handle GetFakeHandleForTest() {
+ static int fake_handle = 10;
+ return Handle(fake_handle++, false);
+ }
#elif defined(USE_X11)
typedef int Handle; // These two ints are SysV IPC shared memory keys
typedef int Id;
@@ -88,6 +102,13 @@
// Returns a default, invalid handle, that is meant to indicate a missing
// Transport DIB.
static Handle DefaultHandleValue() { return -1; }
+
+ // Returns a value that is ONLY USEFUL FOR TESTS WHERE IT WON'T BE
+ // ACTUALLY USED AS A REAL HANDLE.
+ static Handle GetFakeHandleForTest() {
+ static int fake_handle = 10;
+ return fake_handle++;
+ }
#endif
// Create a new TransportDIB, returning NULL on failure.
« no previous file with comments | « no previous file | app/x11_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698