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

Side by Side Diff: content/common/gpu/client/gpu_context_tests.h

Issue 1812033002: Restore earlyouts in SignalTests on Windows for IPC flavour of the tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: earlyouts: . Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « content/browser/gpu/gpu_ipc_browsertests.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // These tests are run twice: 5 // These tests are run twice:
6 // Once in a gpu test with an in-process WebGraphicsContext3D. 6 // Once in a gpu test with an in-process WebGraphicsContext3D.
7 // Once in a browsertest with a gpu-process WebGraphicsContext3D. 7 // Once in a browsertest with a gpu-process WebGraphicsContext3D.
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 24 matching lines...) Expand all
35 base::RunLoop run_loop; 35 base::RunLoop run_loop;
36 context_support_->SignalQuery( 36 context_support_->SignalQuery(
37 query, 37 query,
38 base::Bind( 38 base::Bind(
39 &RunOnlyOnce, run_loop.QuitClosure(), base::Owned(new int(0)))); 39 &RunOnlyOnce, run_loop.QuitClosure(), base::Owned(new int(0))));
40 run_loop.Run(); 40 run_loop.Run();
41 } 41 }
42 }; 42 };
43 43
44 CONTEXT_TEST_F(SignalTest, BasicSignalSyncTokenTest) { 44 CONTEXT_TEST_F(SignalTest, BasicSignalSyncTokenTest) {
45 #if defined(OS_WIN)
46 // The IPC version of ContextTestBase::SetUpOnMainThread does not succeed on
47 // some platforms.
48 if (!gl_)
49 return;
50 #endif
51
45 const GLuint64 fence_sync = gl_->InsertFenceSyncCHROMIUM(); 52 const GLuint64 fence_sync = gl_->InsertFenceSyncCHROMIUM();
46 gl_->ShallowFlushCHROMIUM(); 53 gl_->ShallowFlushCHROMIUM();
47 54
48 gpu::SyncToken sync_token; 55 gpu::SyncToken sync_token;
49 gl_->GenSyncTokenCHROMIUM(fence_sync, sync_token.GetData()); 56 gl_->GenSyncTokenCHROMIUM(fence_sync, sync_token.GetData());
50 57
51 TestSignalSyncToken(sync_token); 58 TestSignalSyncToken(sync_token);
52 }; 59 };
53 60
54 CONTEXT_TEST_F(SignalTest, EmptySignalSyncTokenTest) { 61 CONTEXT_TEST_F(SignalTest, EmptySignalSyncTokenTest) {
62 #if defined(OS_WIN)
63 // The IPC version of ContextTestBase::SetUpOnMainThread does not succeed on
64 // some platforms.
65 if (!gl_)
66 return;
67 #endif
68
55 // Signalling something that doesn't exist should run the callback 69 // Signalling something that doesn't exist should run the callback
56 // immediately. 70 // immediately.
57 gpu::SyncToken sync_token; 71 gpu::SyncToken sync_token;
58 TestSignalSyncToken(sync_token); 72 TestSignalSyncToken(sync_token);
59 }; 73 };
60 74
61 CONTEXT_TEST_F(SignalTest, InvalidSignalSyncTokenTest) { 75 CONTEXT_TEST_F(SignalTest, InvalidSignalSyncTokenTest) {
76 #if defined(OS_WIN)
77 // The IPC version of ContextTestBase::SetUpOnMainThread does not succeed on
78 // some platforms.
79 if (!gl_)
80 return;
81 #endif
82
62 // Signalling something that doesn't exist should run the callback 83 // Signalling something that doesn't exist should run the callback
63 // immediately. 84 // immediately.
64 gpu::SyncToken sync_token(gpu::CommandBufferNamespace::GPU_IO, 0, 85 gpu::SyncToken sync_token(gpu::CommandBufferNamespace::GPU_IO, 0,
65 gpu::CommandBufferId::FromUnsafeValue(1297824234), 86 gpu::CommandBufferId::FromUnsafeValue(1297824234),
66 9123743439); 87 9123743439);
67 TestSignalSyncToken(sync_token); 88 TestSignalSyncToken(sync_token);
68 }; 89 };
69 90
70 CONTEXT_TEST_F(SignalTest, BasicSignalQueryTest) { 91 CONTEXT_TEST_F(SignalTest, BasicSignalQueryTest) {
92 #if defined(OS_WIN)
93 // The IPC version of ContextTestBase::SetUpOnMainThread does not succeed on
94 // some platforms.
95 if (!gl_)
96 return;
97 #endif
98
71 unsigned query; 99 unsigned query;
72 gl_->GenQueriesEXT(1, &query); 100 gl_->GenQueriesEXT(1, &query);
73 gl_->BeginQueryEXT(GL_COMMANDS_ISSUED_CHROMIUM, query); 101 gl_->BeginQueryEXT(GL_COMMANDS_ISSUED_CHROMIUM, query);
74 gl_->Finish(); 102 gl_->Finish();
75 gl_->EndQueryEXT(GL_COMMANDS_ISSUED_CHROMIUM); 103 gl_->EndQueryEXT(GL_COMMANDS_ISSUED_CHROMIUM);
76 TestSignalQuery(query); 104 TestSignalQuery(query);
77 gl_->DeleteQueriesEXT(1, &query); 105 gl_->DeleteQueriesEXT(1, &query);
78 }; 106 };
79 107
80 CONTEXT_TEST_F(SignalTest, SignalQueryUnboundTest) { 108 CONTEXT_TEST_F(SignalTest, SignalQueryUnboundTest) {
109 #if defined(OS_WIN)
110 // The IPC version of ContextTestBase::SetUpOnMainThread does not succeed on
111 // some platforms.
112 if (!gl_)
113 return;
114 #endif
115
81 GLuint query; 116 GLuint query;
82 gl_->GenQueriesEXT(1, &query); 117 gl_->GenQueriesEXT(1, &query);
83 TestSignalQuery(query); 118 TestSignalQuery(query);
84 gl_->DeleteQueriesEXT(1, &query); 119 gl_->DeleteQueriesEXT(1, &query);
85 }; 120 };
86 121
87 CONTEXT_TEST_F(SignalTest, InvalidSignalQueryUnboundTest) { 122 CONTEXT_TEST_F(SignalTest, InvalidSignalQueryUnboundTest) {
123 #if defined(OS_WIN)
124 // The IPC version of ContextTestBase::SetUpOnMainThread does not succeed on
125 // some platforms.
126 if (!gl_)
127 return;
128 #endif
129
88 // Signalling something that doesn't exist should run the callback 130 // Signalling something that doesn't exist should run the callback
89 // immediately. 131 // immediately.
90 TestSignalQuery(928729087); 132 TestSignalQuery(928729087);
91 TestSignalQuery(928729086); 133 TestSignalQuery(928729086);
92 TestSignalQuery(928729085); 134 TestSignalQuery(928729085);
93 TestSignalQuery(928729083); 135 TestSignalQuery(928729083);
94 TestSignalQuery(928729082); 136 TestSignalQuery(928729082);
95 TestSignalQuery(928729081); 137 TestSignalQuery(928729081);
96 }; 138 };
97 139
98 }; 140 };
OLDNEW
« no previous file with comments | « content/browser/gpu/gpu_ipc_browsertests.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698